1 / 28

# loglinear contingency table analysis - PowerPoint PPT Presentation

Loglinear Contingency Table Analysis. Karl L. Wuensch Dept of Psychology East Carolina University. The Data. Weight Cases by Freq. Crosstabs. Cell Statistics. LR Chi-Square. Model Selection Loglinear. HILOGLINEAR happy(1 2) marital(1 3) /CRITERIA ITERATION(20) DELTA(0)

Related searches for loglinear contingency table analysis

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'loglinear contingency table analysis' - niveditha

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Loglinear Contingency Table Analysis

Karl L. Wuensch

Dept of Psychology

East Carolina University

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

• The smaller the Chi-Square, the better the fit between model and data.

• The LR Chi-Square for Happy x Marital has the same value we got with Crosstabs

• 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

• 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.

• 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.

• For Happy = 1 (yes),  = +.885

• Accordingly, for Happy =2 (no),  is ‑.885.

• 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.

• 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.

• 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.

• 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, ………

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.

• A main effects only model does a poor job of predicting the cell counts.

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

• 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.

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.

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;

GENLOG happy marital

/MODEL=POISSON

/PRINT=FREQ DESIGN ESTIM CORR COV

/PLOT=NONE

/CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(0)

/DESIGN.

• Uses dummy coding, not effects coding.

• Dummy = One level versus reference level

• Effects = One level versus versus grand mean

• I don’t like it.

• 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.