CWEIGHT Subcommand (LOGLINEAR command)
CWEIGHT
specifies
cell weights, such as structural zeros, for a model. By default, cell
weights are equal to 1.
- The specification is either one numeric variable or a matrix of weights enclosed in parentheses.
- If a matrix of weights is specified, the matrix must contain the same number of elements as the product of the levels of the categorical variables. An asterisk can be used to signify repetitions of the same value.
- If weights are specified for a multiple-factor model, the index value of the rightmost factor increments the most rapidly.
- If a numeric variable is specified, only one
CWEIGHT
subcommand can be used onLOGLINEAR
. - To use multiple cell weights on the same
LOGLINEAR
command, specify all weights in matrix format. Each matrix must be specified on a separateCWEIGHT
subcommand, and eachCWEIGHT
specification remains in effect until explicitly overridden by anotherCWEIGHT
subcommand. -
CWEIGHT
can be used to impose structural, or a priori, zeros on the model. This feature is useful in the analysis of symmetric tables.
Example
COMPUTE CWT=1.
IF (HUSED EQ WIFED) CWT=0.
LOGLINEAR HUSED WIFED(1,4) WITH DISTANCE
/CWEIGHT=CWT
/DESIGN=HUSED WIFED DISTANCE.
-
COMPUTE
initially assigns CWT the value 1 for all cases. -
IF
assigns CWT the value 0 when HUSED equals WIFED. -
CWEIGHT
imposes structural zeros on the diagonal of the symmetric crosstabulation. Because a variable name is specified, only oneCWEIGHT
can be used.
Example
LOGLINEAR HUSED WIFED(1,4) WITH DISTANCE
/CWEIGHT=(0, 4*1, 0, 4*1, 0, 4*1, 0)
/DESIGN=HUSED WIFED DISTANCE
/CWEIGHT=(16*1)
/DESIGN=HUSED WIFED DISTANCE.
- The first
CWEIGHT
matrix specifies the same values as variable CWT provided in the first example. The specified matrix is as follows:0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0
- The same matrix can be specified in full as (0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0).
- By using the matrix format on
CWEIGHT
rather than a variable name, a differentCWEIGHT
subcommand can be used for the second model.