08-14-2016 04:40 PM
How can I calculate the probability of a logistic regression model given the values of independent variables not only by hand but also by SAS? Please show me some sample code.
08-14-2016 05:30 PM - edited 08-14-2016 05:33 PM
This is known as scoring a model.
As of SAS 9.4 there's the CODE statement that will generate the code you need to score your data.
See several of the options with example code here:
This thread has a fully worked example that's a manual process BEFORE the availability of the CODE statement.
I'd use the CODE option now.
08-14-2016 09:49 PM
Note that the CODE generation is not implemented for all models. I learned the hard way (not in the doc) that I can't get the code for scoring a model containing a constructed spline effect. I am using version 13.1 but I don't see any mention of the feature being added to more recent versions.
08-14-2016 10:12 PM
There are about three way to score data: CODE , SCORE, STORE statements. Check documentation example Example 72.16: Scoring Data Sets . The simplest is SCORE proc logistic data=Crops; model Crop=x1-x4 / link=glogit; score data=Test out=Score1; run;
Need further help from the community? Please ask a new question.