The SCORE statement enables you to compute predicted values and other statistics for a SAS data set. As with the OUTPUT statement, the new data set that is created contains all the variables in the input data set and, optionally, the estimates of , the expected value of the response variable, and the probability that the response variable will take the current value or other values that you specify. In a zero-inflated model, you can additionally request that the output data set contain the estimates of and the probability that the response is zero as a result of the zero-generating process. For the Conway-Maxwell-Poisson model, the estimates of , , , , mode, variance, and dispersion are also available. Except for the probability of the current value, these statistics can be computed for all observations in which the regressors are not missing, even if the response is missing.
The following statements fit a Poisson model by using the DocVisit
data set. Additional observations in the additionalPatients
data set are used to compute expected values by using the SCORE statement. The data in the additionalPatients data set are
not used during the fitting stage and are used only for scoring.
You score a data set in two separate steps. In the first step, you fit the model and use the STORE statement to preserve it
in the DocVisitPoisson
item store, as shown in the following statements:
proc countreg data=docvisit; model doctorvisits=sex illness income / dist=poisson; store docvisitPoisson; run;
In the second step, you retrieve the content of the DocVisitPoisson
item store and use it to calculate expected values by using the SCORE statement for the additionalPatients
data set as follows:
proc countreg restore=docvisitPoisson data=additionalPatients; score out=outScores mean=meanPoisson probability=prob; run;
By retrieving the model from the item store and using it in a postprocessing step, you can separate the fitting and scoring stages and use data for scoring that might not be available at the time when the model was fitted.
You can specify only one SCORE statement. You can specify the following output-options: