RANDOM Subcommand (GENLINMIXED command)

The RANDOM subcommand specifies the random effects in the mixed model.

  • Depending on the covariance type specified, random effects specified in one RANDOM subcommand may be correlated.
  • One block of the covariance G matrix will be constructed for each RANDOM subcommand. The dimension of the random effect covariance G matrix is equal to the sum of the levels of all random effects across all RANDOM subcommands.
  • When the variance components (VC) structure is specified, a scaled identity (ID) structure will be assigned to each of the effects specified. This is the default covariance type for the RANDOM subcommand.
  • Use a separate RANDOM subcommand when a different covariance structure is assumed for a list of random effects. If the same effect is listed on more than one RANDOM subcommand, it must be associated with a different SUBJECT combination.
  • No random effects are included in the mixed model unless a RANDOM subcommand is specified correctly.

EFFECTS. The effect list includes all effects to be included in the random effects model block except for the intercept, which is specified using the USE_INTERCEPT keyword.

  • To include a term for the main effect of a factor (categorical predictor) or covariate (continuous predictor), enter its field name. Whether a field is treated as a factor or covariate depends upon its measurement level.
  • To include a term for an interaction between factors, use the keyword BY or an asterisk (*) to join the factors involved in the interaction. For example, A*B means a two-way interaction effect of A and B, where A and B are factors. A*A is not allowed because factors in an interaction effect must be distinct.
  • To include a term for nesting one effect within another, use a pair of parentheses. For example, A(B) means that A is nested within B.
  • Multiple nesting is allowed. For example, A(B(C)) means that B is nested within C, and A is nested within B(C). When more than one pair of parentheses is present, each pair of parentheses must be enclosed or nested within another pair of parentheses. Thus, A(B)(C) is not valid.
  • Interactions between nested effects are not valid. For example, neither A(C)*B(C) nor A(C)*B(D) is valid.
  • Covariates can be connected, but not nested, through the * operator to form another covariate effect. Interactions among covariates such as X1*X1 and X1*X2 are valid, but X1(X2) is not.
  • Factor and covariate effects can be connected only by the * operator. Suppose A and B are factors, and X1 and X2 are covariates. Examples of valid factor-by-covariate interaction effects are A*X1, A*B*X1, X1*A(B), A*X1*X1, and B*X1*X2.

USE_INTERCEPT. This keyword controls whether an intercept term is included in the model. It is invalid to specify USE_INTERCEPT=FALSE if there are no effects specified on the EFFECTS keyword. The default is FALSE.

Examples

GENLINMIXED
  /FIXED EFFECTS=a b
  /RANDOM SUBJECTS=id.

GENLINMIXED
  /FIXED EFFECTS=a b
  /RANDOM USE_INTERCEPT=TRUE SUBJECTS=id.

GENLINMIXED
  /FIXED EFFECTS=a b
  /RANDOM EFFECTS=c d SUBJECTS=id.
  • The first command fails because the RANDOM subcommand has no effects or intercept. The next two commands succeed.

SUBJECTS Keyword

The SUBJECTS keyword identifies subjects in the active dataset. Complete independence is assumed across subjects, but responses within subjects are assumed to be correlated.

  • Specify a single field or a list of fields connected by asterisks (*) or the keyword BY.
  • The number of subjects equals the number of distinct combinations of values of the fields.
  • The fields in the RANDOM SUBJECTS list must be a subset of the fields on the DATA_STRUCTURE SUBJECTS list.
  • The SUBJECTS keyword is optional.

GROUPING Keyword

The GROUPING keyword allows you to define independent sets of covariance parameters. All subjects have the same covariance type; subjects within the same covariance grouping will have the same values for the parameters.

  • Specify a single categorical field or a list of categorical fields connected by asterisks (*) or the keyword BY.
  • Each distinct combination of the values of the fields defines a separate covariance grouping.
  • A field specified on the GROUPING keyword can also be used as a SUBJECTS or REPEATED_MEASURES field, the TARGET on the FIELDS subcommand, or on the EFFECTS keyword or the FIXED or RANDOM subcommand.
  • The GROUPING keyword is optional.

COVARIANCE_TYPE Keyword

The COVARIANCE_TYPE keyword gives the covariance structure of the random effect covariance matrix.

  • Random effects are considered independent of each other, and a separate covariance matrix is computed for each effect.

AR1. First-order autoregressive.

ARMA11. Autoregressive moving average (1,1).

COMPOUND_SYMMETRY. This structure has constant variance and constant covariance.

DIAGONAL. This is a diagonal structure with heterogenous variance.

IDENTITY. This is a scaled identity matrix.

UNSTRUCTURED. This is a completely general covariance matrix.

VARIANCE_COMPONENTS. Variance components. This is the default covariance structure for random effects. The variance components structure for random effects is a scaled identity (ID) structure assigned to each of the effects specified on the subcommand.