LMIXED Procedure

Syntax: LMIXED Procedure

The following statements are available in the LMIXED procedure:

  • PROC LMIXED <options>;

  • BLUP OUT=libref.data-table <options>;

  • BY variables;

  • CLASS variable <(options )> <variable <(options)>> </ global-options>;

  • CONTRAST ’label’ contrast-specification <, contrast-specification> <, > </ options>;

  • DISPLAY <table-list> </ options>;

  • DISPLAYOUT table-spec-list </ options>;

  • EFFECT name=effect-type (variables </ options>);

  • ESTIMATE ’label’ contrast-specification <(divisor=n)><, ’label’ contrast-specification <(divisor=n)>> <, …> </ options>;

  • FREQ variable;

  • LSMEANS fixed-effects </ options>;

  • LSMESTIMATE fixed-effect <'label'> values <divisor=n> <, <'label'> values <divisor=n>> <, …> </ options>;

  • MARGINS fixed-effects </ options>;

  • MODEL dependent = <fixed-effects> </ options>;

  • OPTIMIZATION <options>;

  • OUTPUT OUT=libref.data-table<COPYVARS=(variables)><keyword <=name>>…<keyword <=name>>;

  • PARMS <(value-list) …> </ options>;

  • RANDOM random-effects </options>;

  • REPEATED repeated-effect </options>;

  • SLICE model-effect </options>;

  • STORE <OUT=>libref.data-table;

  • TEST fixed-effects </options>;

  • WEIGHT variable;

Items within angle brackets ( < > ) are optional.

The PROC LMIXED and MODEL statements are required, and the MODEL statement must appear after the CLASS statement if a CLASS statement is included. The RANDOM statement must follow the MODEL statement. The CLASS, CONTRAST, EFFECT, ESTIMATE, LSMEANS, LSMESTIMATE, MARGINS, RANDOM, SLICE, and TEST statements can appear multiple times. Other statements can appear only once.

The BLUP, BY, CONTRAST, ESTIMATE, LSMEANS, LSMESTIMATE, MARGINS, MODEL, OPTIMIZATION, OUTPUT, PARMS, RANDOM, REPEATED, SLICE, TEST, and WEIGHT statements are described in full in alphabetical order after the PROC LMIXED statement. The CLASS and EFFECT statements are described by summarizing their functionality and syntax; for more information about these statements, see Chapter 2, Shared Concepts (SAS Visual Statistics: Procedures).

Table 1 summarizes the basic functions and important options and statements that are supported by the LMIXED procedure.

Table 1: Summary of PROC LMIXED Statements

Statement Description Important Options
PROC LMIXED Invokes the procedure The DATA= option specifies the input data table; the METHOD= option specifies the estimation method.
BLUP Creates a data table that contains the estimation of fixed and random effects The OUT= option specifies the output data table; the SOLVER= option specifies the mixed model equations solver.
CLASS Declares qualitative variables that create indicator variables in and matrices None
CONTRAST Constructs custom linear hypothesis tests The E option displays the matrix coefficients.
ESTIMATE Constructs custom linear estimates The CL option produces confidence limits.
LSMEANS Computes least squares means for classification fixed effects The DIFF option computes differences of the least squares means; the CL option produces confidence limits; the SLICE= option tests simple effects.
LSMESTIMATE Computes least squares means estimates for classification fixed effects The ADJUST= option determines the method of multiple comparison adjustment; the FTEST option produces an F test.
MARGINS Computes predictive margins of fixed effects The DIFF= option computes differences of predictive margins; the SLICEBY= option computes predictive margins by slices.
MODEL Specifies the dependent variable and the fixed effects, setting up The S option requests a solution for fixed-effects parameters.
OPTIMIZATION Controls aspects of the nonlinear optimizations The TECHNIQUE= option specifies the optimization technique.
OUTPUT Creates a data table that contains observationwise statistics The ALLSTATS option requests that all statistics be computed.
PARMS Specifies a grid of initial values for the covariance parameters The HOLD= and NOITER options hold the covariance parameters or their ratios constant; the PARMSDATA= option reads the initial values from a data table.
RANDOM Specifies random effects, setting up and The SUBJECT= option creates block-diagonality; the TYPE= option specifies the covariance structure; the S option requests a solution for the random effects.
REPEATED Specifies The SUBJECT= option creates block-diagonality; the TYPE= option specifies covariance structure; the R= option displays estimated blocks of ; the GROUP= option enables between-subject heterogeneity.
SLICE Performs a partitioned analysis of the LS-means for an interaction The SLICEBY option provides a simple effect to partition the LS-means.
STORE Saves the model and results of the statistical analysis The OUT= option specifies the name of the table where the model and results are stored.
TEST Performs hypothesis tests on the fixed effects The CHISQ option performs tests in addition to any F tests.


Last updated: May 14, 2026