Building a Model

About Mixed Models

The Form for a Mixed Model

Here is the form for a mixed model: y equals x beta plus z gamma plus epsilon. Click image for alternative formats..
In this equation, y represents univariate data, beta. Click image for alternative formats. is an unknown vector of fixed effects with known model matrix X, gamma. Click image for alternative formats. is an unknown vector of random effects with known model matrix Z, and epsilon. Click image for alternative formats. is an unknown random error vector.
Using the Mixed Models task, you can add fixed, random, and repeated effects to your model.
By default, no effects are specified, which results in the task fitting an intercept-only model.
Here is what you see on the Model tab:
Model Effects in the Mixed Models Task
To specify a model effect, you must assign at least one variable to the Classification variables role or the Continuous variables role. On the Model tab, click Edit Icon to open the Model Effects Builder.
In the Mixed Models task, you can create fixed effects, random effects, and repeated effects. (You can have only one repeated effect.) These effects are added to the model in the order in which they appear on the Model tab.
Here is an example of a Model tab that contains a fixed effect, a random effect, and a repeated effect.
Example of Fixed Effects, Random Effects, and Repeated Effects

Create a Fixed Effect

For fixed effects, the intercept is included by default. To add additional fixed effects, click Edit Icon to open the Fixed Effects Builder.

Create a Random Effect

You can have multiple random effects in the model.
To create a random effect, click Add Random Model Icon to open the Random Effects Builder. In the Random Effects Builder, you can create these types of single effects: a main effect, a crossed effect, an effect with a polynomial degree of n, and a nested effect.
You can also create a subject effect or a group effect. Specifying a subject effect is equivalent to nesting all other random effects in the subject effect. The group effect is an effect that specifies heterogeneity in the covariance structure of the R matrix. All observations that have the same level of the group effect have the same covariance parameters.
To create a subject effect or group effect:
  1. In the Random Effects Builder, select the variable in the Variables pane.
  2. Select the radio button for Subject effect or Group effect.
  3. Click the button for the single effect that you want to create.
  4. For subject effects, click Covariance Structures to specify the covariance structure of the R matrix. The default covariance structure is standard variance components.

Create a Repeated Effect

You can have only one repeated effect in the model. Only classification variables can be used to create a repeated effect.
To create a repeated effect, click Add Repeated Effect Icon to open the Repeated Effects Builder. In the Repeated Effects Builder, you can create these types of single effects: a main effect, a crossed effect, an effect with a polynomial degree of n, and a nested effect. Y
You can also create a subject effect or a group effect. Specifying a subject effect is equivalent to nesting all other random effects in the subject effect. The group effect is an effect that specifies heterogeneity in the covariance structure of the R matrix. All observations that have the same level of the group effect have the same covariance parameters.
To create a subject effect or group effect:
  1. In the Repeated Effects Builder, select the variable in the Variables pane.
  2. Select the radio button for Subject effect or Group effect.
  3. Click the button for the single effect that you want to create.
  4. For subject effects, click Covariance Structures to specify the covariance structure of the R matrix. The default covariance structure is standard variance components.

Single Effects

Create a Main Effect

  1. Select the variable name in the Variables box.
  2. Click Add to add the variable to the list of model effects.

Create Crossed Effects (Interactions)

  1. Select two or more variables in the Variables box. To select more than one variable, press Ctrl.
  2. Click Cross.

Create a Polynomial Degree Effect

  1. Select one or more continuous variables in the Variables box.
  2. In the list of single effects, click Polynomial Degree=N.
  3. Specify higher-degree crossings by adjusting the number in the N field.
For example, if you select Age, click Polynomial Degree=N, and specify 3 as the value of N, the Age*Age*Age effect is created.

Create a Nested Effect

Nested effects are specified by following a main effect or crossed effect with a classification variable or list of classification variables enclosed in parentheses. Here are examples of nested effects: B(A), C(B*A), D*E(C*B*A). In this example, B(A) is read "B within A."
  1. Select the classification variable in the Model Effects Builder.
  2. Click Nest. The Nested window appears.
  3. Select the variable to use in the nested effect. Click Outer or Nested within Outer to specify how to create the nested effect.
    Note: The Nested within Outer button is available only when a classification variable is selected.
  4. Select the effect that you want to nest.
  5. Click Add.

Standard Models

Create a Two-Way Factorial

  1. Select two or more variables in the Variables box.
  2. Click Two-Way Factorial.
For example, if you select the Age and Height variables and then click Two-Way Factorial, the Age*Height effect is created.

Create a Full Factorial

  1. Select two or more variables in the Variables box.
  2. Click Full Factorial.
For example, if you select the Height, Weight, and Age variables and then click Full Factorial, these model effects are created: Age, Height, Weight, Age*Height, Age*Weight, Height*Weight, and Age*Height*Weight.

Create an N-Way Factorial

  1. Select two or more variables in the Variables box.
  2. Click N-way Factorial and specify the value of N.
For example, if you select the Height, Weight, and Age variables, click N-way Factorial, and then specify the value of N as 2, these model effects are created: Age, Height, Weight, Age*Height, Age*Weight, and Height*Weight. If N is set to a value greater than the number of variables in the model, N is effectively set to the number of variables.

Create Polynomial Effects of the Nth Order

  1. Select one or more continuous variables in the Variables box.
  2. In the list of standard models, click Polynomial Order=N.
  3. Specify higher-degree crossings by adjusting the number in the N field.
For example, if you select the Age and Height variables, click Polynomial Order=N, and specify 3 as the value of N, these model effects are created: Age, Age*Age, Age*Age*Age, Height, Height*Height, and Height*Height*Height.