BookmarkSubscribeRSS Feed
Xamius32
Calcite | Level 5

SO I am having trouble knowing why my predicted probabilities do not match up with what I expect it to.

I am comparing this:

proc logistic data=natdata outmodel=test333;

class ioclass;

model bad (event='1') = X Y Z

output out=reg_result p=predprob;

run;

And in reg_result there is a estimated probability variable.

Then I manually create a variable called probability which is:

1/(1+e^0(intercept+ X*B1 +Y*B2 + Z*B3))

with B1-B3 being the regression coefficients.

Ignoring differences due to rounding, shouldnt the two columns be the same?

3 REPLIES 3
Reeza
Super User

Post your full code used, the code above doesn't make sense. You specify a class variable but don't use it and the model statement is missing a semicolon.

And yes, the predicted probability will match the calculated probability if done correctly.

Reeza
Super User

Here's a good reference thread that has a worked example.

SteveDenham
Jade | Level 19

It kind of depends on what coding you used for the dependent variable.  Do your predicted probabilities look like (1 - expected prob)?  Or are they completely mucked about?  I wonder about this because of the 0 in your manual equation--I assume that it is a negative sign in your actual calculations.  You might want to add XBETA=logitvalue to the OUTPUT statement to check if your difference is, in fact, due to rounding.  Logitvalue should be equal to (intercept+ X*B1 +Y*B2 + Z*B3).

Steve Denham

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 1286 views
  • 0 likes
  • 3 in conversation