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
KMATRIX
subcommand to be valid, at least one of the following subcommands must be specified: theLMATRIX
subcommand or theINTERCEPT = INCLUDE
subcommand. - If
KMATRIX
is specified butLMATRIX
is not specified, theLMATRIX
is assumed to take the row vector corresponding to the intercept in the estimable function, provided that the subcommandINTERCEPT = INCLUDE
is specified. In this case, the K matrix can be only a scalar matrix. - If
KMATRIX
andLMATRIX
are specified, the number of rows in the requested K and L matrices must be equal. If there are multipleLMATRIX
subcommands, 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
KMATRIX
subcommand 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
LMATRIX
subcommands; both subcommands have two rows. - The first
LMATRIX
subcommand tests whether the effect of A is 0, while the secondLMATRIX
subcommand tests whether the effect of B is 0. - The
KMATRIX
subcommand specifies that the K matrix also has two rows, each row with value 0.