Syntax


The following statements are available in the SCORE procedure.

  • PROC SCORE DATA= SAS-data-set < options > ;

    • BY variables ;

    • ID variables ;

    • VAR variables ;

The only required statement is the PROC SCORE statement. The BY, ID, and VAR statements are described following the PROC SCORE statement.

PROC SCORE Statement

  • PROC SCORE DATA= SAS-data-set < options > ;

You can specify the following options in the PROC SCORE statement.

DATA= SAS-data-set

  • names the input SAS data set containing the raw data to score. This specification is required.

NOSTD

  • suppresses centering and scaling of the raw data. Ordinarily, if PROC SCORE finds _TYPE_ = ˜MEAN', _TYPE_ = ˜USCORE', _TYPE_ = ˜USTD', or _TYPE_ = ˜STD' observations in the SCORE= data set, the procedure uses these to standardize the raw data before scoring.

OUT= SAS-data-set

  • specifies the name of the SAS data set created by PROC SCORE. If you want to create a permanent SAS data set, you must specify a two-level name . (Refer to 'SAS Files' in SAS Language Reference: Concepts for more information on permanent SAS data sets.) If the OUT= option is omitted, PROC SCORE still creates an output data set and automatically names it according to the DATA n convention, just as if you omitted a data set name in a DATA statement.

PREDICT

  • specifies that PROC SCORE should treat coefficients of ˆ’ 1 in the SCORE= data set as 0. In regression applications, the dependent variable is coded with a coefficient of ˆ’ 1. Applied directly to regression results, PROC SCORE produces negative residuals (see the description of the RESIDUAL option, which follows ); the PREDICT option produces predicted values instead.

RESIDUAL

  • reverses the sign of each score. Applied directly to regression results, PROC SCORE produces negative residuals (PREDICT-ACTUAL); the RESIDUAL option produces positive residuals (ACTUAL-PREDICT) instead.

SCORE= SAS-data-set

  • names the data set containing the scoring coefficients. If you omit the SCORE= option, the most recently created SAS data set is used. This data set must have two special variables: _TYPE_ and either _NAME_ or _MODEL_ .

TYPE= name ˜string'

  • specifies the observations in the SCORE= data set that contain scoring coefficients. The TYPE= procedure option is unrelated to the data set option that has the same name. PROC SCORE examines the values of the special variable _TYPE_ in the SCORE= data set. When the value of _TYPE_ matches TYPE= name , the observation in the SCORE= data set is used to score the raw data in the DATA= data set.

  • If you omit the TYPE= option, scoring coefficients are read from observations with either _TYPE_ ='SCORE' or _TYPE_ ='USCORE'. Because the default for PROC SCORE is TYPE=SCORE, you need not specify the TYPE= option for factor scoring or for computing scores from OUTSTAT= data sets from the CANCORR, CANDISC, PRINCOMP, or VARCLUS procedure. When you use regression coefficients from PROC REG, specify TYPE=PARMS.

  • The maximum length of the argument specified in the TYPE= option depends on the length defined by the VALIDVARNAME= SAS system option. For additional information, refer to SAS Language Reference: Dictionary .

  • Note that the TYPE= option setting is not case-sensitive. For example, the two option settings, TYPE='MyScore' and TYPE='myscore', are equivalent.

BY Statement

  • BY variables ;

You can specify a BY statement with PROC SCORE to obtain separate scoring for observations in groups defined by the BY variables. You can also specify a BY statement to apply separate groups of scoring coefficients to the entire DATA= data set.

If your SCORE= input data set is not sorted in ascending order, use one of the following alternatives:

  • Sort the data using the SORT procedure with a similar BY statement.

  • Specify the BY statement option NOTSORTED or DESCENDING in the BY statement for the SCORE procedure. The NOTSORTED option does not mean that the data are unsorted but rather that the data are arranged in groups (according to values of the BY variables) and that these groups are not necessarily in alphabetical or increasing numeric order.

  • Create an index on the BY variables using the DATASETS procedure.

For more information on the BY statement, refer to the discussion in SAS Language Reference: Concepts . For more information on the DATASETS procedure, refer to the discussion in the SAS Procedures Guide .

If the DATA= data set does not contain any of the BY variables, the entire DATA= data set is scored by each BY group of scoring coefficients in the SCORE= data set.

If the DATA= data set contains some but not all of the BY variables, or if some BY variables do not have the same type or length in the DATA= data set as in the SCORE= data set, then PROC SCORE prints an error message and stops.

If all the BY variables appear in the DATA= data set with the same type and length as in the SCORE= data set, then each BY group in the DATA= data set is scored using scoring coefficients from the corresponding BY group in the SCORE= data set. The BY groups in the DATA= data set must be in the same order as in the SCORE= data set. All BY groups in the DATA= data set must also appear in the SCORE= data set. If you do not specify the NOTSORTED option, some BY groups can appear in the SCORE= data set but not in the DATA= data set; such BY groups are not used in computing scores.

ID Statement

  • ID variables ;

The ID statement identifies variables from the DATA= data set to be included in the OUT= data set. If there is no ID statement, all variables from the DATA= data set are included in the OUT= data set. The ID variables can be character or numeric.

VAR Statement

  • VAR variables ;

The VAR statement specifies the variables to be used in computing scores. These variables must be in both the DATA= and SCORE= input data sets and must be numeric. If you do not specify a VAR statement, the procedure uses all numeric variables in the SCORE= data set. You should almost always specify a VAR statement with PROC SCORE because you would rarely use all the numeric variables in your data set to compute scores.




SAS.STAT 9.1 Users Guide (Vol. 6)
SAS.STAT 9.1 Users Guide (Vol. 6)
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net