CQLIM Procedure
Example 12.1 Model with Censoring
This example uses the CQLIM procedure to process a large data table.
The following DATA step generates a data set that contains 5 million observations from a censored model. The model contains seven variables.
data simulate;
call streaminit(12345);
array vars x1-x7;
array parms{7} (3 4 2 4 -3 -5 -3);
intercept = 2;
do i = 1 to 5000000;
sum_xb = 0;
do j = 1 to 7;
vars[j] = rand('NORMAL', 0, 1);
sum_xb = sum_xb + parms[j] * vars[j];
end;
y = intercept + sum_xb + 100 * rand('NORMAL', 0, 1);
if y > 400 then y = 400;
if y < 0 then y = 0;
output;
end;
keep y x1-x7;
run;
You can load the data set simulate into a data table in your session that is associated with the mylib libref. The DATA step assumes that your libref is named mylib, but you can substitute any appropriately defined libref.
data mylib.simulate;
set simulate;
run;
The following statements estimate a censored model:
proc cqlim data = mylib.simulate;
model y = x1-x7 / censored(lb = 0 ub = 400);
run;
Output 12.1.1 shows the estimation results for the censored model. The "Model Fit Summary" table shows detailed information about the model. All parameter estimates in the "Parameter Estimates" table are highly significant and correspond to their theoretical values that were set during the data generating process.
Output 12.1.1: Censored Model: Summary
| Summary Statistics of Continuous Responses | |||||||
|---|---|---|---|---|---|---|---|
| Variable | Mean | Standard Error | Type | Lower Bound | Upper Bound | N Obs Lower Bound | N Obs Upper Bound |
| y | 41.11168 | 59.338269 | Censored | 0 | 400 | 246E4 | 189 |
| Model Fit Summary | |
|---|---|
| Dependent Variable | y |
| Number of Observations | 5000000 |
| Data Set | SIMULATE |
| Log Likelihood | -1.702E7 |
| Maximum Absolute Gradient | 1.806E-9 |
| Number of Iterations | 7 |
| Optimization Method | Newton-Raphson |
| AIC | 34043697 |
| SBC | 34043817 |
| Covariance Estimation | Hessian |
| Convergence criterion (FCONV=1E-11) satisfied. |
| Parameter Estimates | |||||
|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standard Error | t Value | Approx Pr > |t| |
| Intercept | 1 | 2.045243 | 0.054689 | 37.40 | <.0001 |
| x1 | 1 | 3.021825 | 0.049348 | 61.23 | <.0001 |
| x2 | 1 | 4.006987 | 0.049345 | 81.20 | <.0001 |
| x3 | 1 | 1.955760 | 0.049327 | 39.65 | <.0001 |
| x4 | 1 | 4.045403 | 0.049338 | 81.99 | <.0001 |
| x5 | 1 | -3.020339 | 0.049310 | -61.25 | <.0001 |
| x6 | 1 | -5.041650 | 0.049351 | -102.16 | <.0001 |
| x7 | 1 | -2.950510 | 0.049362 | -59.77 | <.0001 |
| _Sigma | 1 | 100.015057 | 0.049335 | 2027.25 | <.0001 |