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
CWEIGHTsubcommand can be used onLOGLINEAR. - To use multiple cell weights on the same
LOGLINEARcommand, specify all weights in matrix format. Each matrix must be specified on a separateCWEIGHTsubcommand, and eachCWEIGHTspecification remains in effect until explicitly overridden by anotherCWEIGHTsubcommand. -
CWEIGHTcan 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.
-
COMPUTEinitially assigns CWT the value 1 for all cases. -
IFassigns CWT the value 0 when HUSED equals WIFED. -
CWEIGHTimposes structural zeros on the diagonal of the symmetric crosstabulation. Because a variable name is specified, only oneCWEIGHTcan 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
CWEIGHTmatrix 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
CWEIGHTrather than a variable name, a differentCWEIGHTsubcommand can be used for the second model.