SCORE DATA=SAS-data-set OUT=SAS-data-set </ option>;
The SCORE statement produces kernel density estimates at arbitrary locations for an associated UNIVAR or BIVAR statement.
You must specify the following arguments:
You can provide the following option in the SCORE statement.
You can include multiple SCORE statements. Each SCORE statement applies to the first UNIVAR or BIVAR statement that specifies the same variables as are included in the DATA= data set. The order of variables matters for the bivariate case. Therefore, a SCORE statement that specifies a DATA= data set consisting of variables x and y (in that order) will match only a BIVAR statement of one of the following forms:
BIVAR (x y)…</ options>;
BIVAR x y …</ options>;
Suppose the data set MyData contains the variables x and y and the data sets MyScoreInX, MyScoreInY, and MyScoreInXY contain the variables x, y, and (x, y) respectively. The following statements request both the individual (univariate) and joint (bivariate) kernel density estimates and distributions and selectively score them:
proc kde data=MyData;
univar x y;
bivar x y / CDF;
score data=MyScoreInX out=MarginalX;
score data=MyScoreInY out=MarginalY;
score data=MyScoreInXY out=JointXY;
run;
The first SCORE statement is associated with the UNIVAR statement and produces the MarginalX output data set. This data set contains variables x, value, and density, where density is the density function at value.
The second SCORE statement is associated with the UNIVAR statement and produces the MarginalY output data set. This data set contains variables y, value and density, where density is the density function at value.
The third SCORE statement is associated with the BIVAR statement and produces the JointXY output data set. This data set contains variables x, value1, y, value2, density, and distribution, where density and distribution are the density and distribution functions, respectively, at (value1, value2).