turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Forecasting
- /
- Predictive Probabilities

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-01-2017 02:44 PM - edited 08-01-2017 02:48 PM

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

08-02-2017
02:45 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Shawn08

08-01-2017 03:14 PM

Shawn08 wrote:

The 'p' variable created gives me the predicted probabilities for each

observationsin the dataset. However, I would like to estimate the probability byvariablesinstead of byobservations. 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.

All Replies

Solution

08-02-2017
02:45 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Shawn08

08-01-2017 03:14 PM

Shawn08 wrote:

The 'p' variable created gives me the predicted probabilities for each

observationsin the dataset. However, I would like to estimate the probability byvariablesinstead of byobservations. 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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

08-03-2017 09:23 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Shawn08

08-03-2017 03:13 PM

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Shawn08

08-02-2017 11:28 AM

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