The SCORE Procedure

Example 102.1 Factor Scoring Coefficients

(View the complete code for this example.)

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 102.1.1 through Output 102.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 102.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 102.1.1: Creating an OUTSTAT= Data Set with PROC FACTOR

Factor Scoring Example

The FACTOR Procedure

Input Data TypeRaw Data
Number of Records Read12
Number of Records Used12
N for Significance Tests12

Factor Scoring Example

The FACTOR Procedure
Initial Factor Method: Principal Components


Prior Communality Estimates: ONE

Eigenvalues of the Correlation Matrix: Total
= 5 Average = 1
 EigenvalueDifferenceProportionCumulative
12.309306381.117106860.46190.4619
21.192199520.309972490.23840.7003
30.882227020.379659900.17640.8767
40.502567130.388867170.10050.9773
50.11369996 0.02271.0000


2 factors will be retained by the MINEIGEN criterion.

Factor Pattern
 Factor1Factor2
Age0.297950.93675
Weight0.43282-0.17750
RunTime0.919830.28782
RunPulse0.72671-0.38191
RestPulse0.81179-0.23344

Variance Explained by Each
Factor
Factor1Factor2
2.30930641.1921995

Final Communality Estimates: Total = 3.501506
AgeWeightRunTimeRunPulseRestPulse
0.966283510.218834010.928933330.673962070.71349297

Factor Scoring Example

The FACTOR Procedure
Rotation Method: Varimax

Orthogonal Transformation Matrix
 12
10.925360.37908
2-0.379080.92536

Rotated Factor Pattern
 Factor1Factor2
Age-0.079390.97979
Weight0.46780-0.00018
RunTime0.742070.61503
RunPulse0.81725-0.07792
RestPulse0.839690.09172

Variance Explained by Each
Factor
Factor1Factor2
2.14877531.3527306

Final Communality Estimates: Total = 3.501506
AgeWeightRunTimeRunPulseRestPulse
0.966283510.218834010.928933330.673962070.71349297

Factor Scoring Example

The FACTOR Procedure
Rotation Method: Varimax


Scoring Coefficients Estimated by Regression

Squared Multiple Correlations
of the Variables with Each
Factor
Factor1Factor2
1.00000001.0000000

Standardized Scoring Coefficients
 Factor1Factor2
Age-0.178460.77600
Weight0.22987-0.06672
RunTime0.277070.37440
RunPulse0.41263-0.17714
RestPulse0.39952-0.04793


Output 102.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 102.1.2: OUTSTAT= Data Set from PROC FACTOR Reproduced with PROC PRINT

Factor Scoring Example
Data Set from PROC FACTOR

Obs_TYPE__NAME_AgeWeightRunTimeRunPulseRestPulse
1MEAN 42.416780.512510.6483172.91755.6667
2STD 2.84316.76601.84448.9189.2769
3N 12.000012.000012.000012.00012.0000
4CORRAge1.00000.01280.5005-0.095-0.0080
5CORRWeight0.01281.00000.26370.1730.2396
6CORRRunTime0.50050.26371.00000.5560.6620
7CORRRunPulse-0.09530.17310.55551.0000.4853
8CORRRestPulse-0.00800.23960.66200.4851.0000
9COMMUNAL 0.96630.21880.92890.6740.7135
10PRIORS 1.00001.00001.00001.0001.0000
11EIGENVAL 2.30931.19220.88220.5030.1137
12UNROTATEFactor10.29800.43280.91980.7270.8118
13UNROTATEFactor20.9368-0.17750.2878-0.382-0.2334
14TRANSFORFactor10.9254-0.3791...
15TRANSFORFactor20.37910.9254...
16PATTERNFactor1-0.07940.46780.74210.8170.8397
17PATTERNFactor20.9798-0.00020.6150-0.0780.0917
18SCOREFactor1-0.17850.22990.27710.4130.3995
19SCOREFactor20.7760-0.06670.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 102.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 102.1.3: OUT= Data Set from PROC SCORE Reproduced with PROC PRINT

Factor Scoring Example
Data Set from PROC SCORE

ObsAgeWeightOxygenRunTimeRestPulseRunPulseFactor1Factor2
14489.4744.60911.37621780.821290.35663
24075.0745.31310.07621850.71173-0.99605
34485.8454.2978.6545156-1.460640.36508
44268.1559.5718.1740166-1.76087-0.27657
53889.0249.8749.22551780.55819-1.67684
64777.4544.81111.6358176-0.001131.40715
74075.9845.68111.95701760.95318-0.48598
84381.1949.09110.8564162-0.129510.36724
94481.4239.44213.08631740.662670.85740
103881.8760.0558.6348170-0.44496-1.53103
114473.0350.54110.1345168-1.118320.55349
124587.6637.38814.03561861.208361.05948