RANDOM random-effects ~distribution SUBJECT=variable <options>;
The RANDOM statement defines the random effects and their distribution. The random effects must be represented by symbols that appear in your SAS programming statements. The random effects usually influence the mean value of the distribution that is specified in the MODEL statement. The RANDOM statement consists of a list of the random effects (usually just one or two symbols), a tilde (~), the distribution of the random effects, and then a SUBJECT= variable.
The only distribution available for the random effects is normal(m,v), with mean m and variance v.
This syntax is illustrated as follows for one effect:
random u ~ normal(0,s2u) subject=clinic;
For multiple effects, you should specify bracketed vectors for m and v, the latter consisting of the lower triangle of the random-effects variance matrix listed in row order. This is illustrated for two random effects as follows:
random b1 b2 ~ normal([0,0],[g11,g21,g22]) subject=person;
Similarly, the syntax for three random effects is illustrated as follows:
random b1 b2 b3 ~ normal([0,0,0],[g11,g21,g22,g31,g32,g33])
subject=person;
The SUBJECT= variable determines the unique realizations of the random effects.
PROC NLMIXED constructs the subject clusters based on unique values in the SUBJECT= variable. The input data set does not need to be sorted by SUBJECT= variable.
You can specify multiple RANDOM statements. When you specify more than one RANDOM statement, PROC NLMIXED assumes that the SUBJECT= variable from each RANDOM statement forms a containment hierarchy. For more information, see the section Hierarchical Model Specification. The syntax for two RANDOM statements is illustrated as follows:
random r11 ~ normal(0,sd1) subject = school;
random r21 ~ normal(0,sd2) subject = class(school);
You can specify the following options in the RANDOM statement: