LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI,...

32
LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM

Transcript of LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI,...

Page 1: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

LOGLINEAR MODELS FOR INDEPENDENCE ANDINTERACTION IN THREE-WAY TABLESBY ENI SUMARMININGSIH, SSI, MM

Page 2: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Table Structure For Three Dimensions

•When all variables are categorical, a multidimensional contingency table displays the data

•We illustrate ideas using thr three-variables case.

•Denote the variables by X, Y, and Z. We display the distribution of X-Y cell count at different level of Z using cross sections of the three way contingency table (called partial tables)

Page 3: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

•The two way contingency table obtained by combining the partial table is called the X-Y marginal table (this table ignores Z)

Page 4: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Death Penalty ExampleDefendant’srace

Victim’s Race

Death Penalty Percentage YesYes No

White White 19 132 12.6

Black 0 9 0

Black White 11 52 17.5

Black 6 97 5.8

Page 5: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Marginal tableDefendant’sRace

Death Penalty Total

Yes No

White 19 141 160

Black 17 149 166

36 290 326

Page 6: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Partial and Marginal Odd Ratio

Partial Odd ratio describe the association when the third variable is controlledThe Marginal Odd ratio describe the association when the Third variable is ignored (i.e when we sum the counts over the levels of the third variable to obtain a marginal two-way table)

Page 7: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Association

Variables

P-D P-V D-V

Marginal 1.18 2.71 25.99

Partial Level 1 0.67 2.80 22.04

Level 2 0.79 3.29 25.90

Page 8: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Types of IndependenceA three-way IXJXK cross-classification of response variables X, Y, and Zhas several potential types of independenceWe assume a multinomial distribution with cell probabilities {i jk}, and

The models also apply to Poisson sampling with means }.

The three variables are mutually independent when

Page 9: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Similarly, X could be jointly independent of Y and Z, or Z could be jointlyindependent of X and Y. Mutual independence (8.5) implies joint independenceof any one variable from the others.X and Y are conditionally independent, given Z when independence holds for each partial table within which Z is fixed. That is, if

then

Page 10: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.
Page 11: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Homogeneous Association and Three-Factor Interaction

Page 12: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Marginal vs Conditional Independence

•Partial association can be quite different from marginal association

•For further illustration, we now see that conditional independence of X and Y, given Z, does not imply marginal independence of X and Y

•The joint probability in Table 5.5 show hypothetical relationship among three variables for new graduate of a university

Page 13: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Table 5.5 Joint ProbabilityMajor Gender Income

Low High

Liberal Art Female 0.18 0.12

Male 0.12 0.08

Science or Engineering

Female 0.02 0.08

Male 0.08 0.32

Total Female 0.20 0.20

Male 0.20 0.40

Page 14: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

The association between Y=income at first job(high, low) and X=gender(female, male) at two level of Z=major discipline (liberal art, science or engineering) is described by the odd ratios

Income and gender are conditionally independent, given major

Page 15: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Marginal Probability of Y and XGender Income

low high

Female 0.18+0.02=0.20 0.12+0.08=0.20

Male 0.12+0.08=0.20 0.08+0.32=0.40

Total 0.40 0.60

The odd ratio for the (income, gender) from marginal table =2The variables are not independent when we ignore major

Page 16: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

•Suppose Y is jointly independent of X and Z, so

Then And summing both side over i we obtain=Therefore

Page 17: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

So X and Y are also conditionally independent.In summary, mutual indepedence of the variables implies that Y is jointly independent of X and Z, which itself implies that X and Y are conditionaaly independent.Suppose Y is jointly independent of X and Z,

that is . Summing over k on both side, we obtain

Thus, X and Y also exhibit marginal independence

Page 18: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

So, joint independence of Y from X and Z (or X from Y and Z) implies X and Y are both marginally and condotionally independent. Since mutual independence of X, Y and Z implies that Y is jointly independent of X and Z, mutual independence also implies that X and Y are both marginally and conditionally independentHowever, when we know only that X and Y are conditionally independent, Summing over k on both sides, we obtain

Page 19: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

•All three terms in the summation involve k, and this does not simplify to marginal independence

Page 20: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

A model that permits all three pairs to be conditionally dependent is

Model 8.11. is called the loglinear model of homogeneous association or of no three-factor interaction.

Page 21: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Loglinear Models for Three Dimensions•Hierarchical Loglinear ModelsLet {ijk} denote expected frequencies. Suppose all ijk >0 and let ijk = log ijk .

A dot in a subscript denotes the average with respect to that index; for instance, We set

, ,

Page 22: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

The sum of parameters for any index equals zero. That is

Page 23: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

The general loglinear model for a three-way table is

This model has as many parameters as observations and describes all possible positive i jk

Setting certain parameters equal to zero in 8.12. yields the modelsintroduced previously. Table 8.2 lists some of these models. To ease referringto models, Table 8.2 assigns to each model a symbol that lists the highest-order term(s) for each variable

Page 24: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Interpreting Model Parameters

Interpretations of loglinear model parameters use their highest-order terms.For instance, interpretations for model (8.11). use the two-factor terms todescribe conditional odds ratios

At a fixed level k of Z, the conditional association between X and Y uses (I- 1)(J – 1). odds ratios, such as the local odds ratios

Similarly, ( I – 1)(K – 1) odds ratios {i (j)k} describe XZ conditional association, and (J – 1)(K – 1) odds ratios {(i) jk} describe YZ conditionalassociation.

Page 25: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Loglinear models have characterizations using constraints on conditional odds ratios. For instance, conditional independence of X and Yis equivalent to {i j(k)} = 1, i=1, . . . , I-1, j=1, . . . , J-1, k=1, . . . , K.substituting (8.11) for model (XY, XZ, YZ) into log i j(k) yields

Any model not having the three-factor interaction term has a homogeneousassociation for each pair of variables.

Page 26: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

For 2x2x2 tables

Page 27: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Alcohol, Cigarette, and Marijuana Use Example

Table 8.3 refers to a 1992 survey by the Wright State University School ofMedicine and the United Health Services in Dayton, Ohio. The survey asked2276 students in their final year of high school in a nonurban area nearDayton, Ohio whether they had ever used alcohol, cigarettes, or marijuana.Denote the variables in this 222 table by A for alcohol use, C forcigarette use, and M for marijuana use.

Page 28: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.
Page 29: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Table 8.5 illustrates model association patterns by presenting estimatedconditional and marginal odds ratios

For example, the entry 1.0 for the AC conditional association for the model (AM, CM) of AC conditional independence is the common value of the AC fitted odds ratios at the two levels of M,

Page 30: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

The entry 2.7 for the AC marginal association for this model is the odds ratiofor the marginal AC fitted tableTable 8.5 shows that estimated conditional odds ratios equal 1.0 for eachpairwise term not appearing in a model, such as the AC association in model( AM, CM).For that model, the estimated marginal AC odds ratio differs from 1.0, since conditional independence does not imply marginal independence.Model (AC, AM, CM) permits all pairwise associations but maintainshomogeneous odds ratios between two variables at each level of the third.The AC fitted conditional odds ratios for this model equal 7.8.One can calculate this odds ratio using the model’s fitted values at either level of M, or from (8.14) using

Page 31: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

INFERENCE FOR LOGLINEAR MODELS

Chi-Squared Goodness-of-Fit Tests

As usual, X 2 and G2 test whether a model holds by comparing cell fittedvalues to observed counts

Where nijk = observed frequency and =expected frequency Here df equals the number of cell counts minus the number of model parameters.For the student survey (Table 8.3), Table 8.6 shows results of testing fit forseveral loglinear models.

𝑋 2=∑𝑖∑

𝑗∑𝑘

(𝑛𝑖𝑗𝑘−�̂�𝑖𝑗𝑘 )2

�̂�𝑖𝑗𝑘

=2

Page 32: LOGLINEAR MODELS FOR INDEPENDENCE AND INTERACTION IN THREE-WAY TABLES BY ENI SUMARMININGSIH, SSI, MM.

Models that lack any association term fit poorly

The model ( AC, AM, CM) that has all pairwise associations fits well (P=0.54)It is suggested by other criteria also, such as minimizing

AIC= - 2(maximized log likelihood - number of parameters in model)or equivalently, minimizing [G2- 2(df)].