Forecasting using SAS Forecast Server, SAS/ETS, and more

Predictive Probabilities

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Predictive Probabilities

[ Edited ]

Hi,

 

I try to use the proc logistic command in order to obtain the predicted probabilities of each of my variables. Here is the code I am currently using:

proc logistic data=gabarit_final simple alpha=0.05 descending;
	class fin_dec
			cons (ref="0")
			fed (ref="0") 
			EE (ref="0")
			educ_can (ref="0")
			/ param=ref;
	model fin_dec =
			cons
			fed
			nbr_ess_quali
			nbr_multi_crit
			EE
			educ_can
			/link=probit;
	output out=pred predicted=p;
run;
quit;

 

The 'p' variable created gives me the predicted probabilities for each observations in the dataset. However, I would like to estimate the probability by variables instead of by observations. For example, how could I calculate what is the probability of fin_dec = 1 if EE = 1 and the probability of fin_dec = 1 if EE = 0.

 

Would it be better to use proc qlim or proc probit in order to achieve my goal?

 

Thank you in advance,


Accepted Solutions
Solution
3 weeks ago
Super User
Posts: 17,842

Re: Predictive Probabilities


Shawn08 wrote:

 

The 'p' variable created gives me the predicted probabilities for each observations in the dataset. However, I would like to estimate the probability by variables instead of by observations. For example, how could I calculate what is the probability of fin_dec = 1 if EE = 1 and the probability of fin_dec = 1 if EE = 0.

 

If you're including other variables you still need to consider them - typically this would mean setting them to the mean or reference value. I think you can obtain this in PROC LOGISTIC using ESTIMATE statements.  

I'm surprised you're not reporting the ODDS RATIOS though, usually in a logistic model, that's what would be of interest.

 

View solution in original post


All Replies
Solution
3 weeks ago
Super User
Posts: 17,842

Re: Predictive Probabilities


Shawn08 wrote:

 

The 'p' variable created gives me the predicted probabilities for each observations in the dataset. However, I would like to estimate the probability by variables instead of by observations. For example, how could I calculate what is the probability of fin_dec = 1 if EE = 1 and the probability of fin_dec = 1 if EE = 0.

 

If you're including other variables you still need to consider them - typically this would mean setting them to the mean or reference value. I think you can obtain this in PROC LOGISTIC using ESTIMATE statements.  

I'm surprised you're not reporting the ODDS RATIOS though, usually in a logistic model, that's what would be of interest.

 

Occasional Contributor
Posts: 9

Re: Predictive Probabilities

Hi,

 

I would have another question. I'm attemping to manually calculate the predicted value, but I'm unable to do so with the following code:

ods trace on;
ods output ParameterEstimates = estimate;
proc logistic data=gabarit_final simple alpha=0.05 descending outest=out;
	class fin_dec
			cons (ref="0")
			metho_AT (ref="0")
			metho_AA (ref="0")
			fed (ref="0") 
			EE (ref="0")
			educ_can (ref="0")
			multi_crit (ref="0")
			/ param=ref;
	model fin_dec =
			cons
			metho_AT
			metho_AA
			fed
			nbr_ess_quali
			multi_crit
			EE
			educ_can
			/link=probit technique=newton expb;
	output out=pred predicted=p xbeta=xb;
	score data=gabarit_final out=estimates2;
run;
ods trace off;

 

The coefficient I get is the comparison between the 0 and 1 of each variable. However, I am unable to use these in order to manually calculate the predicted value. I know that I don't need to calculate it as it is already given, but I would like to learn how SAS does it in order to understand a bit more how SAS work.

 

Thank you very much

Super User
Posts: 17,842

Re: Predictive Probabilities

http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html

https://communities.sas.com/t5/SAS-Statistical-Procedures/How-to-determine-logistic-regression-formu...

I think the CODE option from the first link is a good example. The second has a fully worked example you can walk through.
Super User
Posts: 9,682

Re: Predictive Probabilities

Also check EFFECTPLOT  statement and using ODS OUTPUT to get its result.  Calling @Rick_SAS

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 278 views
  • 4 likes
  • 3 in conversation