DESIGN Subcommand (LOGLINEAR command)
DESIGN
specifies
the model or models to be fit. If DESIGN
is omitted or used with no specifications, the saturated model is
produced. The saturated model fits all main effects and all interaction
effects.
- To specify more than one model, use more than one
DESIGN
subcommand. EachDESIGN
specifies one model. - To obtain main-effects models, name all the variables listed on the variables specification.
- To obtain interactions, use the keyword
BY
to specify each interaction, as in A BY B and C BY D. To obtain the single-degree-of-freedom partition of a specified contrast, specify the partition in parentheses following the factor (see the example below). - To include cell covariates in the model, first identify
them on the variable list by naming them after the keyword
WITH
, and then specify the variable names onDESIGN
. - To specify an equiprobability model, name a cell covariate that is actually a constant of 1.
Example
* Testing the linear effect of the dependent variable
COMPUTE X=MONTH.
LOGLINEAR MONTH (1,12) WITH X
/DESIGN X.
- The variable specification identifies MONTH as a categorical variable with values
1 through 12. The keyword
WITH
identifies X as a covariate. -
DESIGN
tests the linear effect of MONTH.
Example
* Specifying main effects models
LOGLINEAR A(1,4) B(1,5)
/DESIGN=A
/DESIGN=A,B.
- The first design tests the homogeneity of category probabilities for B; it fits the marginal frequencies on A, but assumes that membership in any of the categories of B is equiprobable.
- The second design tests the independence of A and B. It fits the marginals on both A and B.
Example
* Specifying interactions
LOGLINEAR A(1,4) B(1,5) C(1,3)
/DESIGN=A,B,C, A BY B.
- This design consists of the A main effect, the B main effect, the C main effect, and the interaction of A and B.
Example
* Single-degree-of-freedom partitions
LOGLINEAR A(1,4) BY B(1,5)
/CONTRAST(B)=POLYNOMIAL
/DESIGN=A,A BY B(1).
- The value 1 following B refers to the first partition of B, which is the linear effect of B; this follows from the contrast specified on the
CONTRAST
subcommand.
Example
* Specifying cell covariates
LOGLINEAR HUSED WIFED(1,4) WITH DISTANCE
/DESIGN=HUSED WIFED DISTANCE.
- The continuous variable DISTANCE is identified as a cell covariate by specifying it after
WITH
on the variable list. The cell covariate is then included in the model by naming it onDESIGN
.
Example
* Equiprobability model
COMPUTE X=1.
LOGLINEAR MONTH(1,18) WITH X
/DESIGN=X.
- This model tests whether the frequencies in the 18-cell table are equal by using a cell covariate that is a constant of 1.