BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rhys
Obsidian | Level 7
ods graphics on;
proc logistic data=sample outmodel = model_output plots(only)=roc;	
	model target(event = "1") = var1--var20;
	weight w;
run;
ods graphics off;

where w = 1 or 0;

 

Hello, if I run the above code, I'm hoping I'll fit a model based on the data where my weight variable is 1 and the output statistics will be where my weight variable is 0?

 

Will the roc plot include all my data or just where w = 1?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Any observation that has weight=0 is excluded from the model and is not used in the fitting.  If you use an output statement such as 

   output out=out prob=prob resdev=resdev xbeta=xbeta;

then some statistics (such as PROB and XBETA) will be present for all observations, regardless of the weight value.

However, residuals (such as RESDEV), which depend on having a response value, will have missing values when weight=0 because those responses are not part of the data that were used to fit the model.

 

The ROC curve is composed of the points for which weight is NOT zero.  You can use the OUTROC= option on the MODEL statement to see the points used in the ROC curve. 

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

Any observation that has weight=0 is excluded from the model and is not used in the fitting.  If you use an output statement such as 

   output out=out prob=prob resdev=resdev xbeta=xbeta;

then some statistics (such as PROB and XBETA) will be present for all observations, regardless of the weight value.

However, residuals (such as RESDEV), which depend on having a response value, will have missing values when weight=0 because those responses are not part of the data that were used to fit the model.

 

The ROC curve is composed of the points for which weight is NOT zero.  You can use the OUTROC= option on the MODEL statement to see the points used in the ROC curve. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 3301 views
  • 0 likes
  • 2 in conversation