10.2  Loglinear Models for Threeway Tables
In this section we will extend the concepts we learned about loglinear models for twoway tables to threeway tables. We will learn how to fit varous models of independence discussed in Lesson 5, e.g., conditional independence, joint independence and homogenous associations model. We will also learn additional statistics, besides the usual X^{2} and G^{2}, to assess the model fit, and to choose the "best" model.
Key concepts:
Objectives:
Readings

Expanding the loglinear model notation to 3way tables:
\(\text{log}(\mu_{ijk})=\lambda+\lambda_i^A+\lambda_j^B+\lambda_k^C+\lambda_{ij}^{AB}+\lambda_{ik}^{AC}+\lambda_{jk}^{BC}+\lambda_{ijk}^{ABC}\)
The main questions for this lesson are:
 What do the λ terms mean in this model?
 What hypothesis about them correspond to the models of independence we already know?
 What are some efficient ways to specify and interpret these models and tables?
 What are some efficient ways to fit and select among many possible models in three and higher dimensions?
As before for threeway tables, there are multiple models we can test, and now fit. The loglinear models we will fit and evaluate are:
Example  Graduate Admissions
Let us go back to our familiar dataset on graduate admissions at Berkeley:
Dept.

Men rejected

Men accepted

Women rejected

Women accepted

A

313

512

19

89

B

207

353

8

17

C

205

120

391

202

D

278

139

244

131

E

138

53

299

94

F

351

22

317

24

Let D = department, S = sex, and A = admission status (rejected or accepted). We analyzed this as a threeway table before, and specifically we looked at partial and marginal tables. Now we will look at it from a loglinear model point of view. You will work with this example on the next homework as well. Let y be the frequency or count in a particular cell of the threeway table. See berkelyLoglin.sas (and berkeley.sas) or berkeleyLoglin.R (and berkeley.R).