|
Using the DESIGN Output Option
|
This example uses PROC TRANSREG and the DESIGN o-option to prepare an input data set with classification variables for the LOGISTIC procedure. The DESIGN o-option specifies that the goal is design matrix creation, not analysis. When you specify DESIGN, dependent variables are not required. The DEVIATIONS (or EFFECTS) t-option requests a deviations-from-means coding of the classification variables, which is the same coding the CATMOD procedure uses. PROC TRANSREG automatically creates a macro variable &_TrgInd that contains the list of independent variables created. This macro is used in the PROC LOGISTIC MODEL statement. (See Figure 93.75.) For comparison, the same analysis is also performed with PROC CATMOD. The following statements create Figure 93.75:
title 'Using PROC TRANSREG to Create a Design Matrix';
data a;
do y = 1, 2;
do a = 1 to 4;
do b = 1 to 3;
w = ceil(uniform(1) * 10 + 10);
output;
end;
end;
end;
run;
proc transreg data=a design;
model class(a b / deviations);
id y w;
output out=coded;
run;
proc print;
title2 'PROC TRANSREG Output Data Set';
run;
title2 'PROC LOGISTIC with Classification Variables';
proc logistic;
freq w;
model y = &_trgind;
run;
title2 'PROC CATMOD Should Produce the Same Results';
proc catmod data=a;
model y = a b;
weight w;
run;
Figure 93.75
The PROC TRANSREG Design Matrix
The LOGISTIC Procedure
WORK.CODED |
y |
2 |
w |
binary logit |
Fisher's scoring |
Probability modeled is y=1.
Convergence criterion (GCONV=1E-8) satisfied. |
521.858 |
524.378 |
525.785 |
547.939 |
519.858 |
512.378 |
7.4799 |
5 |
0.1873 |
7.4312 |
5 |
0.1905 |
7.3356 |
5 |
0.1969 |
1 |
-0.00040 |
0.1044 |
0.0000 |
0.9969 |
1 |
-0.0802 |
0.1791 |
0.2007 |
0.6542 |
1 |
0.2001 |
0.1800 |
1.2363 |
0.2662 |
1 |
-0.1350 |
0.1819 |
0.5514 |
0.4578 |
1 |
-0.2392 |
0.1500 |
2.5436 |
0.1107 |
1 |
0.3433 |
0.1474 |
5.4223 |
0.0199 |
0.923 |
0.650 |
1.311 |
1.222 |
0.858 |
1.738 |
0.874 |
0.612 |
1.248 |
0.787 |
0.587 |
1.056 |
1.410 |
1.056 |
1.882 |
54.0 |
0.163 |
37.8 |
0.177 |
8.2 |
0.082 |
35156 |
0.581 |
1 |
1 |
31 |
1 |
2 |
31 |
1 |
3 |
34 |
2 |
1 |
26 |
2 |
2 |
33 |
2 |
3 |
37 |
3 |
1 |
36 |
3 |
2 |
29 |
3 |
3 |
28 |
4 |
1 |
26 |
4 |
2 |
35 |
4 |
3 |
29 |
Maximum likelihood computations converged. |
1 |
0.00 |
0.9969 |
3 |
1.50 |
0.6823 |
2 |
5.64 |
0.0597 |
6 |
2.81 |
0.8329 |
-0.00040 |
0.1044 |
0.00 |
0.9969 |
-0.0802 |
0.1791 |
0.20 |
0.6542 |
0.2001 |
0.1800 |
1.24 |
0.2662 |
-0.1350 |
0.1819 |
0.55 |
0.4578 |
-0.2392 |
0.1500 |
2.54 |
0.1107 |
0.3434 |
0.1474 |
5.42 |
0.0199 |
Copyright © SAS Institute Inc. All rights reserved.