LMATRIX Subcommand (UNIANOVA command)

The LMATRIX subcommand allows you to customize your hypotheses tests by specifying the L matrix (contrast coefficients matrix) in the general form of the linear hypothesis LB = K, where K = 0 if it is not specified on the KMATRIX subcommand. The vector B is the parameter vector in the linear model.

  • The basic format for the LMATRIX subcommand is an optional label in quotation marks, an effect name or the keyword ALL, and a list of real numbers. There can be multiple effect names (or the keyword ALL) and number lists.
  • The optional label is a string with a maximum length of 255 characters. Only one label can be specified.
  • Only valid effects appearing or implied on the DESIGN subcommand can be specified on the LMATRIX subcommand.
  • The length of the list of real numbers must be equal to the number of parameters (including the redundant ones) corresponding to that effect. For example, if the effect A*B takes up six columns in the design matrix, then the list after A*B must contain exactly six numbers.
  • A number can be specified as a fraction with a positive denominator—for example, 1/3 or –1/3, but 1/–3 is invalid.
  • A semicolon (;) indicates the end of a row in the L matrix.
  • When ALL is specified, the length of the list that follows ALL is equal to the total number of parameters (including the redundant ones) in the model.
  • Effects appearing or implied on the DESIGN subcommand must be explicitly specified here.
  • If LMATRIX is specified along with the ROBUST subcommand, then contrast estimates and tests are calculated with the robust covariance matrix, in addition to the tests that use the standard (or model-based) covariance matrix.
  • Multiple LMATRIX subcommands are allowed. Each is treated independently.

Example

UNIANOVA DEP BY A B
  /LMATRIX = "B1 vs B2 at A1"
              B 1 -1 0 A*B 1 -1 0 0 0 0 0 0 0
  /LMATRIX = "Effect A"
              A 1 0 -1 
              A*B 1/3  1/3  1/3
                   0    0    0
                 -1/3 -1/3 -1/3;
              A 0 1 -1
              A*B  0    0    0
                  1/3  1/3  1/3
                 -1/3 -1/3 -1/3
  /LMATRIX = "B1 vs B2 at A2"
             ALL  0
                  0  0  0
                  1 -1  0
                  0  0  0  1 -1  0 0  0  0
  /DESIGN = A, B, A*B.

Assume that factors A and B each have three levels. There are three LMATRIX subcommands; each is treated independently.

  • B1 versus B2 at A1. In the first LMATRIX subcommand, the difference is tested between levels 1 and 2 of effect B when effect A is fixed at level 1. Since there are three levels each in effects A and B, the interaction effect A*B takes up nine columns in the design matrix.
  • Effect A. In the second LMATRIX subcommand, effect A is tested. Since there are three levels in effect A, at most two independent contrasts can be formed; thus, there are two rows in the L matrix, which are separated by a semicolon (;). The first row tests the difference between levels 1 and 3 of effect A, while the second row tests the difference between levels 2 and 3 of effect A.
  • B1 versus B2 at A2. In the last LMATRIX subcommand, the keyword ALL is used. The first 0 corresponds to the intercept effect; the next three zeros correspond to effect A.