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.
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.
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 multinomial logistical regression, generate coefficients and plot leverage.;
ods graphics on;
proc logistic data = dataset2 plots =(leverage (MAXPOINTS = None))
class event(REF='1')/ PARAM=ref;
MODEL event = &coeff_10/ link = glogit rsq scale=none aggregate noint;
ods graphics off;
ods pdf close;
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