KMATRIX Subcommand (GLM: Univariate command)
The KMATRIX subcommand allows you to customize your hypothesis tests by specifying
the K matrix (contrast results
matrix) in the general form of the linear hypothesis LB = K. The vector B is the parameter
vector in the linear model.
- The default K matrix is a zero matrix; that is, LB = 0 is assumed.
- For the
KMATRIXsubcommand to be valid, at least one of the following subcommands must be specified: theLMATRIXsubcommand or theINTERCEPT = INCLUDEsubcommand. - If
KMATRIXis specified butLMATRIXis not specified, theLMATRIXis assumed to take the row vector corresponding to the intercept in the estimable function, provided that the subcommandINTERCEPT = INCLUDEis specified. In this case, the K matrix can be only a scalar matrix. - If
KMATRIXandLMATRIXare specified, the number of rows in the requested K and L matrices must be equal. If there are multipleLMATRIXsubcommands, all requested L matrices must have the same number of rows, and K must have the same number of rows as these L matrices. - A semicolon (;) can be used to indicate the end of a row in the K matrix.
- If more than one
KMATRIXsubcommand is specified, only the last subcommand is in effect.
Example
GLM DEP BY A B
/LMATRIX = “Effect A”
A 1 0 -1; A 1 -1 0
/LMATRIX = “Effect B”
B 1 0 -1; B 1 -1 0
/KMATRIX = 0; 0
/DESIGN = A B.
In this example, assume that factors A and B each have three levels.
- There are two
LMATRIXsubcommands; both subcommands have two rows. - The first
LMATRIXsubcommand tests whether the effect of A is 0, while the secondLMATRIXsubcommand tests whether the effect of B is 0. - The
KMATRIXsubcommand specifies that the K matrix also has two rows, each row with value 0.