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

How to model binary response with only categorial explanatory variables?

 

The syntax wont let it happen after "model y = ", which doesn't make any sense at all.

 

And where do I check weight of each categorial var value?  cant see any of them in proc logistic result, does that mean no var in class is selected? which doesn't make any sense twice at all.

 

upset enough...  

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

You can use continuous and/or categorical predictor variables in the model. Categorical predictors should be specified in the CLASS statement as well as the MODEL statement. The CLASS statement tells the procedure to create a set of numerically-coded variables to represent the original variable in the model. See the example titled "Logistic Modeling with Categorical Predictors" in the LOGISTIC documentation. By "weights", I assume you mean the parameter estimates of the model. Those are in the Estimate column of the Analysis of Maximum Likelihood Estimates table in the LOGISTIC output.

View solution in original post

5 REPLIES 5
StatDave
SAS Super FREQ

You can use continuous and/or categorical predictor variables in the model. Categorical predictors should be specified in the CLASS statement as well as the MODEL statement. The CLASS statement tells the procedure to create a set of numerically-coded variables to represent the original variable in the model. See the example titled "Logistic Modeling with Categorical Predictors" in the LOGISTIC documentation. By "weights", I assume you mean the parameter estimates of the model. Those are in the Estimate column of the Analysis of Maximum Likelihood Estimates table in the LOGISTIC output.

kimmygzc
Obsidian | Level 7
Thanks Sir! you saved my day!
I thought class and model are mutually exclusive...
try to put cats in model, error says should be numeric
try to put cats in class, didn't even calc them in model

that make all the senses now. Thank you very much.
kimmygzc
Obsidian | Level 7
One more question Sir,

I have a cat of hundreds values, and it makes the result too large to display, can I select the predictors of top-n significant estimators, and how?
kimmygzc
Obsidian | Level 7
or hide class level infomation would work, but I dont see any opt to turn it off..
Reeza
Super User
Logistic regression in SAS works fine with all categorical predictors. If you're having issues with your code and getting error please include the code and log in your posts.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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