# Loglinear Possibility Table Examination - PowerPoint PPT Presentation  Loglinear Possibility Table Examination ## Loglinear Possibility Table Examination

##### Presentation Transcript

1. Loglinear Contingency Table Analysis Karl L. Wuensch Dept of Psychology East Carolina University

2. The Data

3. Weight Cases by Freq

4. Crosstabs

5. Cell Statistics

6. LR Chi-Square

7. Model Selection Loglinear HILOGLINEAR happy(1 2) marital(1 3) /CRITERIA ITERATION(20) DELTA(0) /PRINT=FREQ ASSOCIATION ESTIM /DESIGN. • No cells with count = 0, so no need to add .5 to each cell. • Saturated model = happy, marital, Happy x Marital

8. In Each Cell, O=E, Residual = 0

9. The Model Fits the Data Perfectly, Chi-Square = 0 • The smaller the Chi-Square, the better the fit between model and data.

10. Both One- and Two-Way Effects Are Significant • The LR Chi-Square for Happy x Marital has the same value we got with Crosstabs

11. The Model: Parameter Mu • LN(cell freq)ij =  + i + j + ij • We are predicting natural logs of the cell counts. •  is the natural log of the geometric mean of the expected cell frequencies. • For our data, and LN(154.3429) = 5.0392

12. The Model: Lambda Parameters • LN(cell freq)ij =  + i + j + ij • i is the parameter associated with being at level i of the row variable. • There will be (r-1) such parameters for r rows, • And (c-1) lambda parameters, j, for c columns, • And (r-1)(c-1) lambda parameters, for the interaction, ij.

13. Lambda Parameter Estimates

14. Main Effect of Marital Status • For Marital = 1 (married),  = +.397 • for Marital = 2 (single),  = ‑.415 • For each effect, the lambda coefficients must sum to zero, so • For Marital = 3 (split), = 0 ‑ (.397 ‑ .415) = .018.

15. Main Effect of Happy • For Happy = 1 (yes),  = +.885 • Accordingly, for Happy =2 (no),  is ‑.885.

16. Happy x Marital • For cell 1,1 (Happy, Married),  = +.346 • So for [Unhappy, Married],  = -.346 • For cell 1,2 (Happy, Single),  = -.111 • So for [Unhappy, Single],  = +.111 • For cell 1,3 (Happy, Split),  = 0 ‑ (.346 ‑ .111) = ‑.235 • And for [Unhappy, Split], = 0 ‑ (‑.235) = +.235.

17. Interpreting the Interaction Parameters • For (Happy, Married),  = +.346 There are more scores in that cell than would be expected from the marginal counts. • For (Happy, Split),  = 0 ‑.235 There are fewer scores in that cell than would be expected from the marginal counts.

18. Predicting Cell Counts • Married, Happy e(5.0392 + .397 +.885 +.346) = 786 (within rounding error of the actual frequency, 787) • Split, Unhappy e(5.0392 + .018 -.885 +.235) =82, the actual frequency.

19. Testing the Parameters • The null is that lambda is zero. • Divide by standard error to get a z score. • Every one of our effects has at least one significant parameter. • We really should not drop any of the effects from the model, but, for pedagogical purposes, ………

20. Drop Happy x Marital From the Model HILOGLINEAR happy(1 2) marital(1 3) /CRITERIA ITERATION(20) DELTA(0) /PRINT=FREQ RESID ASSOCIATION ESTIM /DESIGN happy marital. • Notice that the design statement does not include the interaction term.

21. Uh-Oh, Big Residuals • A main effects only model does a poor job of predicting the cell counts.

22. Big Chi-Square = Poor Fit • Notice that the amount by which the Chi-Square increased = the value of Chi-Square we got earlier for the interaction term.

23. Pairwise Comparisons • Break down the 3 x 2 table into three 2 x 2 tables. • Married folks report being happy significantly more often than do single persons or divorced persons. • The difference between single and divorced persons falls short of statistical significance.

24. SPSS Loglinear LOGLINEAR Happy(1,2) Marital(1,3) / CRITERIA=Delta(0) / PRINT=DEFAULT ESTIM / DESIGN=Happy Marital Happy by Marital. • Replicates the analysis we just did using Hiloglinear. • More later on the differences between Loglinear and Hiloglinear.

25. SAS Catmod options pageno=min nodateformdlim='-'; data happy; input Happy Marital count; cards; 1 1 787 1 2 221 1 3 301 2 1 67 2 2 47 2 3 82 proccatmod; weight count; model Happy*Marital = _response_; Loglin Happy|Marital; run;

26. PASW GENLOG GENLOG happy marital /MODEL=POISSON /PRINT=FREQ DESIGN ESTIM CORR COV /PLOT=NONE /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(0) /DESIGN.

27. GENLOG Coding • Uses dummy coding, not effects coding. • Dummy = One level versus reference level • Effects = One level versus versus grand mean • I don’t like it.

28. Catmod Output • Parameter estimates same as those with Hilog and loglinear. • For the tests of these paramaters, SAS’ Chi-Square = the square of the z from PASW. • I don’t know how the entries in the ML ANOVA table were computed.