The RANDOM statement defines the regressors of the model, including the intercept, that have random coefficients in a random-parameters model. If you have a panel data set, you can use the RANDOM statement to estimate random-parameters models that include binomial probit, binomial logit, ordinal probit, ordinal logit, linear regression, Tobit, truncated regression, and stochastic frontier models. You do not have to have the observations collected in a panel data setting to model the parameter heterogeneity. Random-parameters models can also be applied to cross-sectional data.
If you only have a group heterogeneity in your error term, or individual specific constant terms as randomly distributed across the groups, then you have a random-effects model and in this case you specify regressors as INTERCEPT (or INT) only.
You can specify only a single RANDOM statement, and if you specify a RANDOM statement, you can specify only one MODEL statement. The RANDOM statement is not supported if a BAYES statement is also specified.
You can specify the following options after a slash (/).
-
SUBJECT=variable
S=variable
-
determines the variable that specifies the ID of the individuals or groups across which the parameter heterogeneity occurs. In panel data, the variable identifies the cross-sectional units. For example, in panel data, the variable might be household or country.
If you do not specify this option, then variable is assumed to have a single realization; that is, there is no variation in the random effects. You should specify this option in order to have a true random-parameters model.
The following statement illustrates this option:
random int / subject=id;
-
METHOD=method-options
M=method-options
-
specifies the method of approximation to the integral that appears in the likelihood function. For more information about the integral and the integration methods, see the section Random-Parameters Models and Panel Data Analysis and its subsections.
You can specify the following method-options:
-
HALTON <(halton-options)>
HALT <(halton-options)>
QMC <(halton-options)>
-
requests a quasi–Monte Carlo integration method that uses the Halton sequences that are defined by the prime numbers starting from 2. For information about how this series is generated, see the section QMC Method Using the Halton Sequence.
You can specify the following halton-options:
-
NDRAW=value
-
determines the number of elements that the Halton series has for each unique value of the subject variable. Therefore, the total number of elements in the Halton sequence is value times the number of unique values of the variable that you specify in the SUBJECT= option. For more information, see the section QMC Method Using the Halton Sequence.
The default value of the NDRAW= option is the number of unique values of the variable that you specify in the SUBJECT= option. For example, if you have a panel data set, the total number of terms in the Halton sequence is the square of the number of cross sections.
-
START=value
specifies the starting point of the Halton sequence, where value must be a positive integer. When you specify this option, value–1 extra draws are created and the initial value–1 elements are discarded. By default, START=11.
The following statement estimates a random-effects model and requests a Halton sequence that has 100 draws for each country and does not discard any draws:
random int / subject=country method=halton(ndraw=100 start=1);
The following statements estimate a random-parameters probit model by specifying a random intercept and unobserved heterogeneity in the coefficients for x1 and x2. The statements request 500 Halton draws and discard the first 50 elements for each of the three sequences.
proc qlim data=a;
model y = x1 x2 x3 / discrete;
random int x1 x2 / subject=id
method=halton(ndraw=500 start=51);
run;
-
HERMITE <(QPOINTS=value)>
HERM <(QPOINTS=value)>
GAUSS <(QPOINTS=value)>
-
requests the Gauss-Hermite quadrature integration method. You can use this method if your model has only one random parameter—that is, if you have a random-effects model or if your model has a single random coefficient. For more information about this method, see the section Approximation by Hermite Quadrature.
QPOINTS=value specifies the number of quadrature points to be used during evaluation of the integral. By default, QPOINTS=20.
The following statements illustrate this option for a random-effects model and a random-parameters model with a single random coefficient on x1:
random int / subject=states method=hermite(qpoints=4);
random x1 / subject=id method=hermite(qpoints=32);
-
SIMULATION <(simulation-options)>
SIM <(simulation-options)>
-
requests Monte Carlo simulation as the method of integration. For more information, see the section Monte Carlo Integration.
You can specify the following simulation-options:
-
NDRAW=value
specifies the number of draws for the simulation. You can also specify the number of draws in the NDRAW= option in the PROC QLIM statement. If you specify this option in both statements, PROC QLIM uses the value in the RANDOM statement. If you do not specify this option in either statement, the default value is set to
, where N is the number of unique values of the subject variable. For example, for a panel data set, N is the number of cross sections.
-
SEED=value
specifies the seed of the random draws, where value must be less than
. You can also specify the seed in the SEED= option in the PROC QLIM statement. If you specify this option in both statements, PROC QLIM uses the value in the RANDOM statement. If you do not specify a seed, or if you specify a value less than or equal to zero, the seed is generated randomly.
The following statement illustrates this option:
random int x1 / subject=id method=simulation(ndraw=1000 seed=12345);
By default, METHOD=HALTON.
-
NOCORRELATION
NOCORR
requests that the random parameters be uncorrelated with one another. If you specify this option, only the diagonal elements of the covariance matrix of the random parameters are estimated.