Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
shl007
Obsidian | Level 7

I am using PROC GENMOD as follows for a binomial logistic regression. I'm trying to find the best way to present the end results to the users. Any suggestions? One approach I tried was to dichotomize my predicted variable based on the rate of the actual y-variable (e.g., if the actual y-variable rate is, say, 10%, then I would dichotomize my predicted variable for any values above 0.10 to be "yes" else "no"). Doing so results in a far higher predicted rate than my actual.

 

After researching this, I saw some posts mention "p = " as an option to add to the output setting. That didn't seem to make much difference.

 

This is the dichotomization I tried as well within a proc sql routine as I was trying to compare the predicted vs. actual. In the end, I'd like to say, by whatever factor(s) or levels therein I group by, the predicted % is this compared to the actual %

 

(case when fit_bd gt 0.10 then 1 else 0 end) as fit_bdbinary

 

PROC GENMOD DATA= &BegDset. DESCENDING;
CLASS &ClassCharVars. &ClassNumVars.;
MODEL bd_flag = &ClassCharVars. &ClassNumVars. &ContVars. / DIST=binomial LINK=logit;
WEIGHT model_weight;
ODS OUTPUT parameterEstimates=&BetasDset.;
OUTPUT OUT= &OutputDset. /* p = prob */ PREDICTED=fit_bd;
RUN;
4 REPLIES 4
PaigeMiller
Diamond | Level 26

@shl007 wrote:

I am using PROC GENMOD as follows for a binomial logistic regression. I'm trying to find the best way to present the end results to the users. Any suggestions? One approach I tried was to dichotomize my predicted variable based on the rate of the actual y-variable (e.g., if the actual y-variable rate is, say, 10%, then I would dichotomize my predicted variable for any values above 0.10 to be "yes" else "no"). Doing so results in a far higher predicted rate than my actual.


Changing the data and refitting the model doesn't particularly strike me as a good way to present the results.

 

Exactly what part of the output are you struggling with? What message do you want to get across? What question is this analysis trying to answer?

 

Can you show us the output as a screen capture? (Please use the Insert Photos icon; do not attach files) Capture.PNG

--
Paige Miller
shl007
Obsidian | Level 7

fit PROC GENMODfit PROC GENMOD

shl007
Obsidian | Level 7

This is the fitted predicted value from PROC GENMOD (screenshot above). I'm trying to dichotomize it, with the intent to answer questions such as, these levels of factor X (used as a predictor in my model) have a higher predicted value than other levels of factor X.

 

I have estimates of the various levels/groups in factor X. So I would like to say which groups in factor X have a higher predicted likelihood. 

 

A purely hypothetical example (keeping this generic) may be, if factor X is state, which states correspond to a higher predicted likelihood or higher predicted percentage per PROC GENMOD. That is why I started down the path of dichotomizing the predicted output variable from PROC GENMOD to compare my yes values there to the actuals.

 

Since dichotomizing the predicted variable didn't seem to be working, I tried taking the mean of the predicted fitted variable below ("bkt" is the factor variable whose levels I'm interested in describing/comparing/contrasting the predicted fit; "flag" is the actual dichotonomous outcome as a reference variable). The code is still running as I type this so am seeing how it turns out, but I had hoped dichotomizing would have worked.2025-03-05_13-17-01.png

PaigeMiller
Diamond | Level 26

This is the fitted predicted value from PROC GENMOD (screenshot above). I'm trying to dichotomize it, with the intent to answer questions such as, these levels of factor X (used as a predictor in my model) have a higher predicted value than other levels of factor X.

 

The slopes of the model coefficients will tell you if higher X produces bigger predicted values or not. 

--
Paige Miller

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 484 views
  • 2 likes
  • 2 in conversation