BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
drdee
Obsidian | Level 7

Dear all,

 

I have a dataset scored using several (external) models for predicting probabilities that a certain event occurs. That is, in the dataset I have the binary target variable as well as predicted probabilities from the models, say p_M1, p_M2, .... Now in order to compare these models, I want SAS to compute several fit statistics, like AUC, MSE, AIC.

The code below (inspired by https://blogs.sas.com/content/iml/2018/11/14/compare-roc-curves-sas.html) shows me the ROC curves, and AUC values. How do I obtain the other statistics?

 

 

proc logistic data=dataset;
   model target (event='1') = p_M1 p_M2 / nofit;
   roc 'Model 1' pred=p_M1;
   roc 'Model 1' pred=p_M1;
run;

 

 

 

 

 

not necceceralily obtained by logistic regression.

I want to use 

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

As mentioned in this note (as a method for earlier SAS releases but still usable) you can use the predicted probabilities as the sole predictor in the model to also get the ROC analysis. This method will provide the AIC statistic. If "MSE" denotes "mean square error," then this statistic doesn't apply to logistic regression since logistic models are not fit by a least squares method and therefore does not create sums of squares or mean squares.

View solution in original post

4 REPLIES 4
drdee
Obsidian | Level 7

No sure how to edit my question, of course I meant

proc logistic data=dataset;
   model target (event='1') = p_M1 p_M2 / nofit;
   roc 'Model 1' pred=p_M1;
   roc 'Model 2' pred=p_M2;
run;
StatDave
SAS Super FREQ

As mentioned in this note (as a method for earlier SAS releases but still usable) you can use the predicted probabilities as the sole predictor in the model to also get the ROC analysis. This method will provide the AIC statistic. If "MSE" denotes "mean square error," then this statistic doesn't apply to logistic regression since logistic models are not fit by a least squares method and therefore does not create sums of squares or mean squares.

drdee
Obsidian | Level 7
Thanks for you reply! This is useful.
I believe MSE is a useful statistic for logistic regression models as well, even though they are fit by maximum likelihood. MSE is also called the Brier score.
StatDave
SAS Super FREQ

See the link to the list of Frequently Asked-for Statistics (FASTats) in the Important Links section of the Statistical Procedures Community page. As noted there, the Brier score is available from the FITSTAT option in the SCORE statement of PROC LOGISTIC.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 538 views
  • 5 likes
  • 2 in conversation