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
- /
- SAS Programming
- /
- General Programming
- /
- Plotting leverage in a logistic model when event v...

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-20-2013 05:47 PM

I am trying to create a graph with the leverage plotted against the predicted values of a logistic model in the proc logisitic step. However, my event has three values (0,1,2) where 0 and 2 are the events I want to predict in two separate models. I use the code in the data statement that says plots(only label maxpoints=none)=leverage ... to plot this leverage graph. Now this statement works when my dependent variable is either 0, 1 but when my dependent variable is 0,1,2 it does not plot the leverage for me, but there are no error statements in the log. Does anyone know the code to plot leverage in a logit model with more than 2 values for the dependent variable and/or what I am doing wrong? PS when the event = 1 is the reference in the class statement.

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

Posted in reply to summit10

05-21-2013 10:47 AM

Ar you fitting a generalized logit to all three values, or is your intent to fit entirely separate models to outcomes (0, 1) and (1, 2)? If it is the latter, you might consider using a WHERE statement to limit the responses to the cases of interest. This should enable the leverage plots.

Steve Denham

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

Posted in reply to SteveDenham

05-21-2013 11:18 AM

Hello and thank you so much for your response!

It is a generalized logit model to fit to the outcomes 0 and 2 and 1 is in the base. Below is an example of the code I am using in order to provide you a clearer picture. Again, I am trying to plot leverage against the predicted values for a multinomial logistic model. Thank you!

%let coeff_10 = *variable_list*;

*Sort panel data.;

proc sort data=*dataset1*; by event &coeff_10; run;

* Summarize data.;

proc summary data=*dataset1*; by event &coeff_10;

output out = *dataset2*;

run;

* Run multinomial logistical regression, generate coefficients and plot leverage.;

ods graphics on;

ods pdf;

proc logistic data = *dataset2* plots =(leverage (MAXPOINTS = None))

outest=*dataset*coef;

weight _freq_;

class event(REF='1')/ PARAM=ref;

MODEL event = &coeff_10/ link = glogit rsq scale=none aggregate noint;

run; quit;

ods graphics off;

ods pdf close;

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

Posted in reply to summit10

05-21-2013 11:21 AM

I thought for logistic regression to set the level of the dependent variable it was along the lines of:

model event(event='1') = &coeff_10/....

Rather than the ref level?

If it works though, great