Download presentation
Presentation is loading. Please wait.
Published byMeghan Stevenson Modified over 8 years ago
1
ERIC CANEN, M.S. UNIVERSITY OF WYOMING WYOMING SURVEY & ANALYSIS CENTER EVALUATION 2010: EVALUATION QUALITY SAN ANTONIO, TX NOVEMBER 13, 2010 What Am I Supposed to Do With Three-Way Crosstabs? An Introduction to Log Linear Models
2
2
3
3 Situation What effects? Community Level Communities
4
4 Set Up Matched Communities Pre-Ordinance Post-Ordinance Pre/PostVariables of Interest Would be Seen as cool for smoking Tried smoking during lifetime Friends Smoke Parents Have Favorable Attitude toward Smoking Smoked during past 30 days
5
5 Design Matched Communities Pre/PostEach Variable of Interest 222 X X
6
6 Expectations (Hypotheses)
7
7 NOTE: Hypothetical Data
8
8
9
9
10
10 Analysis Rows Columns Layers Try: Cross Tabulation
11
11
12
12
13
Expected Cell Probabilities: P(AB) = P(A) * P(B) Expected Cell Counts: E(n ab ) = n * P(AB) Expected Cell Probabilities: P(AB|C) = P(A|C) * P(B|C) Expected Cell Counts: E(n ab |C) = n * P(AB|C) Expected Cell Probabilities: P(ABC) = P(A) * P(B) * P(C) Expected Cell Counts: E(n abc ) = n * P(ABC) 13
14
14 Analysis Consider: Logistic Regression
15
15 Analysis Loglinear Models Alternative to Crosstabs Model Based Higher Order Terms Modeling Cell Counts Related to ANOVA Relationship between variables Generalize Linear Models
16
Assumptions Data represent cross tabulated counts No expected cell counts are zero cell counts and no more than 20% of the cells have expected cell counts <=5 If sample size was fixed then the cell counts are expected to follow a multinomial distribution If sample size was not fixed then cell counts are expected to follow a Poisson distribution Models look at relationships or association, like correlation (r statistic) 16
17
Program Commands SAS Proc CatMod procedure Proc GenMod procedure R loglin() function glm() function Stata poisson command (Poison regression) glm command SPSS/PASW GENLOG GENLIN 17
18
18 Saturated Model Or perfect fit model
19
19 In SPSS: Analyze Loglinear General
20
20
21
21
22
22
23
23
24
24
25
25 GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot FUD1_dichot*PREPOSTORD FUD1_dichot*ordinance PREPOSTORD*ordinance FUD1_dichot*PREPOSTORD*ordinance. Run Syntax
26
26 Complete Independence Model
27
27
28
28 NOTE: All main effects… No interactions
29
29 GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot. Run Syntax
30
30 Block Independence Models Testing whether one factor is independent of the relationship between two other factors
31
31
32
32 NOTE: Only one interaction effect
33
33 GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot PREPOSTORD*ordinance. Run Syntax
34
34 Partial Independence Models Testing whether one factor shares or mediates relationships between the other two factors
35
35 NOTE: This is the equivalent to what was being done in the original three-way crosstabs example
36
36 NOTE: There are two interaction effects and they share a single factor
37
37 GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot PREPOSTORD*ordinance PREPOSTORD*FUD1_dichot. Run Syntax
38
38 Uniform Association Model Testing whether the association between any two of the variables is the same at all levels of the third variable.
39
39 NOTE: All three two way interaction effects are present in the model
40
40 GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot PREPOSTORD*ordinance PREPOSTORD*FUD1_dichot FUD1_dichot*ordinance. Run Syntax
41
41 Showing the Effect
42
42 NOTE: Hypothetical Data
43
43 NOTE: Hypothetical Data
44
44 NOTE: Hypothetical Data
45
45 Complete independence model:
46
46 Complete independence model:
47
47 Complete independence model:
48
48 Uniform Association Model:
49
49 Uniform Association Model:
50
50 Uniform Association Model:
51
Tips and Tricks Plot both the observed and expected values for all models Consider if you want to work forward (independent block partial uniform saturated) or backward (saturated uniform block partial independent) Backward maybe quicker Example of non-significant and inconclusive result 51 Run Syntax
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.