Example 86.1 Factor Scoring Coefficients
This example shows how to use PROC SCORE with factor scoring coefficients. First, the FACTOR procedure produces an output
data set containing scoring coefficients in observations identified by _TYPE_
=’SCORE’. These data, together with the original data set Fitness
, are supplied to PROC SCORE, resulting in a data set containing scores Factor1
and Factor2
. The following statements produce Output 86.1.1 through Output 86.1.3:
/* This data set contains only the first 12 observations */
/* from the full data set used in the chapter on PROC REG. */
data Fitness;
input Age Weight Oxygen RunTime RestPulse RunPulse @@;
datalines;
44 89.47 44.609 11.37 62 178 40 75.07 45.313 10.07 62 185
44 85.84 54.297 8.65 45 156 42 68.15 59.571 8.17 40 166
38 89.02 49.874 9.22 55 178 47 77.45 44.811 11.63 58 176
40 75.98 45.681 11.95 70 176 43 81.19 49.091 10.85 64 162
44 81.42 39.442 13.08 63 174 38 81.87 60.055 8.63 48 170
44 73.03 50.541 10.13 45 168 45 87.66 37.388 14.03 56 186
;
proc factor data=Fitness outstat=FactOut
method=prin rotate=varimax score;
var Age Weight RunTime RunPulse RestPulse;
title 'Factor Scoring Example';
run;
proc print data=FactOut;
title2 'Data Set from PROC FACTOR';
run;
proc score data=Fitness score=FactOut out=FScore;
var Age Weight RunTime RunPulse RestPulse;
run;
proc print data=FScore;
title2 'Data Set from PROC SCORE';
run;
Output 86.1.1 shows the PROC FACTOR output. The scoring coefficients for the two factors are shown at the end of the PROC FACTOR output.
Output 86.1.1: Creating an OUTSTAT= Data Set with PROC FACTOR
The FACTOR Procedure
Initial Factor Method: Principal Components
Prior Communality Estimates: ONE |
2.30930638 |
1.11710686 |
0.4619 |
0.4619 |
1.19219952 |
0.30997249 |
0.2384 |
0.7003 |
0.88222702 |
0.37965990 |
0.1764 |
0.8767 |
0.50256713 |
0.38886717 |
0.1005 |
0.9773 |
0.11369996 |
|
0.0227 |
1.0000 |
2 factors will be retained by the MINEIGEN criterion. |
0.29795 |
0.93675 |
0.43282 |
-0.17750 |
0.91983 |
0.28782 |
0.72671 |
-0.38191 |
0.81179 |
-0.23344 |
0.96628351 |
0.21883401 |
0.92893333 |
0.67396207 |
0.71349297 |
The FACTOR Procedure
Rotation Method: Varimax
0.92536 |
0.37908 |
-0.37908 |
0.92536 |
-0.07939 |
0.97979 |
0.46780 |
-0.00018 |
0.74207 |
0.61503 |
0.81725 |
-0.07792 |
0.83969 |
0.09172 |
0.96628351 |
0.21883401 |
0.92893333 |
0.67396207 |
0.71349297 |
The FACTOR Procedure
Rotation Method: Varimax
Scoring Coefficients Estimated by Regression |
-0.17846 |
0.77600 |
0.22987 |
-0.06672 |
0.27707 |
0.37440 |
0.41263 |
-0.17714 |
0.39952 |
-0.04793 |
Output 86.1.2 lists the OUTSTAT= data set from PROC FACTOR. Note that observations 18 and 19 have _TYPE_
=’SCORE’. Observations 1 and 2 have _TYPE_
=’MEAN’ and _TYPE_
=’STD’, respectively. These four observations are used by PROC SCORE.
Output 86.1.2: OUTSTAT= Data Set from PROC FACTOR Reproduced with PROC PRINT
MEAN |
|
42.4167 |
80.5125 |
10.6483 |
172.917 |
55.6667 |
STD |
|
2.8431 |
6.7660 |
1.8444 |
8.918 |
9.2769 |
N |
|
12.0000 |
12.0000 |
12.0000 |
12.000 |
12.0000 |
CORR |
Age |
1.0000 |
0.0128 |
0.5005 |
-0.095 |
-0.0080 |
CORR |
Weight |
0.0128 |
1.0000 |
0.2637 |
0.173 |
0.2396 |
CORR |
RunTime |
0.5005 |
0.2637 |
1.0000 |
0.556 |
0.6620 |
CORR |
RunPulse |
-0.0953 |
0.1731 |
0.5555 |
1.000 |
0.4853 |
CORR |
RestPulse |
-0.0080 |
0.2396 |
0.6620 |
0.485 |
1.0000 |
COMMUNAL |
|
0.9663 |
0.2188 |
0.9289 |
0.674 |
0.7135 |
PRIORS |
|
1.0000 |
1.0000 |
1.0000 |
1.000 |
1.0000 |
EIGENVAL |
|
2.3093 |
1.1922 |
0.8822 |
0.503 |
0.1137 |
UNROTATE |
Factor1 |
0.2980 |
0.4328 |
0.9198 |
0.727 |
0.8118 |
UNROTATE |
Factor2 |
0.9368 |
-0.1775 |
0.2878 |
-0.382 |
-0.2334 |
TRANSFOR |
Factor1 |
0.9254 |
-0.3791 |
. |
. |
. |
TRANSFOR |
Factor2 |
0.3791 |
0.9254 |
. |
. |
. |
PATTERN |
Factor1 |
-0.0794 |
0.4678 |
0.7421 |
0.817 |
0.8397 |
PATTERN |
Factor2 |
0.9798 |
-0.0002 |
0.6150 |
-0.078 |
0.0917 |
SCORE |
Factor1 |
-0.1785 |
0.2299 |
0.2771 |
0.413 |
0.3995 |
SCORE |
Factor2 |
0.7760 |
-0.0667 |
0.3744 |
-0.177 |
-0.0479 |
Since the PROC SCORE statement does not contain the NOSTD option, the data in the Fitness
data set are standardized before scoring. For each variable specified in the VAR statement, the mean and standard deviation
are obtained from the FactOut
data set. For each observation in the Fitness
data set, the variables are then standardized. For example, for observation 1 in the Fitness
data set, the variable Age
is standardized to .
After the data in the Fitness
data set are standardized, the standardized values of the variables in the VAR statement are multiplied by the matching coefficients
in the FactOut
data set, and the resulting products are summed. This sum is output as a value of the new score variable.
Output 86.1.3 displays the FScore
data set produced by PROC SCORE. This data set contains the variables Age
, Weight
, Oxygen
, RunTime
, RestPulse
, and RunPulse
from the Fitness
data set. It also contains Factor1
and Factor2
, the two new score variables.
Output 86.1.3: OUT= Data Set from PROC SCORE Reproduced with PROC PRINT
44 |
89.47 |
44.609 |
11.37 |
62 |
178 |
0.82129 |
0.35663 |
40 |
75.07 |
45.313 |
10.07 |
62 |
185 |
0.71173 |
-0.99605 |
44 |
85.84 |
54.297 |
8.65 |
45 |
156 |
-1.46064 |
0.36508 |
42 |
68.15 |
59.571 |
8.17 |
40 |
166 |
-1.76087 |
-0.27657 |
38 |
89.02 |
49.874 |
9.22 |
55 |
178 |
0.55819 |
-1.67684 |
47 |
77.45 |
44.811 |
11.63 |
58 |
176 |
-0.00113 |
1.40715 |
40 |
75.98 |
45.681 |
11.95 |
70 |
176 |
0.95318 |
-0.48598 |
43 |
81.19 |
49.091 |
10.85 |
64 |
162 |
-0.12951 |
0.36724 |
44 |
81.42 |
39.442 |
13.08 |
63 |
174 |
0.66267 |
0.85740 |
38 |
81.87 |
60.055 |
8.63 |
48 |
170 |
-0.44496 |
-1.53103 |
44 |
73.03 |
50.541 |
10.13 |
45 |
168 |
-1.11832 |
0.55349 |
45 |
87.66 |
37.388 |
14.03 |
56 |
186 |
1.20836 |
1.05948 |