CWEIGHT Subcommand (HILOGLINEAR command)
CWEIGHT
specifies
cell weights for a model. CWEIGHT
is typically used to specify structural zeros in the table. You
can also use CWEIGHT
to adjust
tables to fit new margins.
- You can specify the name of a variable whose values are cell weights, or provide a matrix of cell weights enclosed in parentheses.
- If you use a variable to specify cell weights, you
are allowed only one
CWEIGHT
subcommand. - If you specify a matrix, you must provide a weight for every cell in the contingency table, where the number of cells equals the product of the number of values of all variables.
- Cell weights are indexed by the values of the variables in the order in which they are specified on the variable list. The index values of the rightmost variable change the most quickly.
- You can use the notation n*cw to indicate that cell weight cw is repeated n times in the matrix.
Example
HILOGLINEAR V1(1,2) V2(1,2) V3(1,3)
/CWEIGHT=CELLWGT
/DESIGN=V1*V2, V2*V3, V1*V3.
- This example uses the variable CELLWGT to assign cell weights for the table. Only one
CWEIGHT
subcommand is allowed.
Example
HILOGLINEAR V4(1,3) V5(1,3)
/CWEIGHT=(0 1 1 1 0 1 1 1 0)
/DESIGN=V4, V5.
- The
HILOGLINEAR
command sets the diagonal cells in the model to structural zeros. This type of model is known as a quasi-independence model. - Because both V4 and V5 have three values, weights must be specified for nine cells.
- The first cell weight is applied to the cell in which V4 is 1 and V5 is 1; the second weight is applied to the cell in which V4 is 1 and V5 is 2; and so on.
Example
HILOGLINEAR V4(1,3) V5(1,3)
/CWEIGHT=(0 3*1 0 3*1 0)
/DESIGN=V4,V5.
- This example is the same as the previous example except that the n*cw notation is used.
Example
* An Incomplete Rectangular Table
DATA LIST FREE / LOCULAR RADIAL FREQ.
WEIGHT BY FREQ.
BEGIN DATA
1 1 462
1 2 130
1 3 2
1 4 1
2 1 103
2 2 35
2 3 1
2 4 0
3 5 614
3 6 138
3 7 21
3 8 14
3 9 1
4 5 443
4 6 95
4 7 22
4 8 8
4 9 5
END DATA.
HILOGLINEAR LOCULAR (1,4) RADIAL (1,9)
/CWEIGHT=(4*1 5*0 4*1 5*0 4*0 5*1 4*0 5*1)
/DESIGN LOCULAR RADIAL.
- This example uses aggregated table data as input.
- The
DATA LIST
command defines three variables. The values of LOCULAR and RADIAL index the levels of those variables, so that each case defines a cell in the table. The values of FREQ are the cell frequencies. - The
WEIGHT
command weights each case by the value of the variable FREQ. Because each case represents a cell in this example, theWEIGHT
command assigns the frequencies for each cell. - The
BEGIN DATA
andEND DATA
commands enclose the inline data. - The
HILOGLINEAR
variable list specifies two variables. LOCULAR has values 1, 2, 3, and 4. RADIAL has integer values 1 through 9. - The
CWEIGHT
subcommand identifies a block rectangular pattern of cells that are logically empty. There is one weight specified for each cell of the 36-cell table. - In this example, the matrix form needs to be used
in
CWEIGHT
because the structural zeros do not appear in the actual data. (For example, there is no case corresponding to LOCULAR = 1, RADIAL = 5.) - The
DESIGN
subcommand specifies main effects only for LOCULAR and RADIAL. Lack of fit for this model indicates an interaction of the two variables. - Because there is no
PRINT
orPLOT
subcommand,HILOGLINEAR
produces the default output for an unsaturated model.