Hi,
I'm performing a binary logistic regression, but I want to calculate the probability for each record and append it to the data set, does anyone know how to do this?
Best,
You can use a SCORE statement to score the same dataset as follows -> it will output individual predicted probabilities in column P_1
proc logistic data=<yourdata>;
model y (event="1") = <x1 x2>;
score data=<yourdata> out=want;
run;
The results are identical to the approach suggested by @PGStats , using an OUTPUT statement and the PREDPROBS option assuming you request individual (and not cumulative) probabilities.
proc logistic data=<yourdata>;
model y (event="1") = <x1 x2>;
output out=want predprobs=(individual);
run;
Best,
Look at option PREDPROBS=() in the OUTPUT statement of PROC LOGISTIC.
You can use a SCORE statement to score the same dataset as follows -> it will output individual predicted probabilities in column P_1
proc logistic data=<yourdata>;
model y (event="1") = <x1 x2>;
score data=<yourdata> out=want;
run;
The results are identical to the approach suggested by @PGStats , using an OUTPUT statement and the PREDPROBS option assuming you request individual (and not cumulative) probabilities.
proc logistic data=<yourdata>;
model y (event="1") = <x1 x2>;
output out=want predprobs=(individual);
run;
Best,
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.