TMODEL Procedure

RANDOM Statement

(Experimental)

  • RANDOM random-effects ~distribution <options>;

The RANDOM statement specifies which parameters in the model program are random effects and defines their distribution. The statement consists of a list of the random effects, a tilde (~), and then the distribution of the random effects. The RANDOM statement must also be accompanied by a CROSSSECTION statement, which specifies the subject variables. Only one RANDOM statement can be associated with each FIT statement.

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);

For multiple effects, you should specify bracketed vectors for m and v, the latter consisting of the lower triangular elements 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]);

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]);

The variables that you specify in the CROSSSECTION statement determine the unique realizations of the random effects. The observations for each value of the CROSSSECTION variables must be grouped together in the input data set. PROC TMODEL processes the input data set sequentially and considers an observation to be from a new cross section whenever the values of the CROSSSECTION variables change from the previous observation.

You can specify the following options in the RANDOM statement:

EBESOPT

specifies that the empirical Bayes estimates of the random effects that are computed for each value of the CROSSSECTION variables during the optimization process be computed by performing a nonlinear optimization. When you specify this option, the optimizer that you specify in the OPTIMIZER= option in the FIT statement is used to compute the empirical Bayes estimates. By default, a Newton search algorithm computes the empirical Bayes estimates.

NOPSD

specifies that the covariance matrix of random effects not be constrained to be positive semidefinite. This option might improve convergence properties for certain parameterizations of the random-effects covariance matrix.

NUMQUADPTS=n

specifies the number of quadrature points to use in the adaptive Gaussian quadrature approximation of the likelihood function. Each random effect is evaluated at n points during the approximation of the likelihood function, so if there are r random effects, the likelihood function is evaluated at nSuperscript r points. By default, NUMQUADPTS=1.

PSD

specifies that the covariance matrix of random effects be constrained to be positive semidefinite. PSD is the default.

Last updated: June 19, 2025