BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I wanted to know that, while developing a logistic regression do i use categorical variables in class statement and obtain individual coeffs for each of the categories or should i not use class statement and so obtain only one coeff for a categorical variable?

Pls help.
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
If the categorical variable has more than two levels, you must either use the class statement or recode the variable into multiple two-level variables. If you don't, then you are treating the variable as a ratio scale rather than nominal scale variable.

If the categorical variable is binary, coded 0/1, then you get the same inference using either the CLASS statement or treating the variable as continuous.
deleted_user
Not applicable
Thanks..

The categorical vars in my data has more than 2 categories..and some have even 10-12 categories...
i have divided the data into 70:30 ratio for model building and development respectively. So when i use class statement, i will get estimates for each of the categories.. i would like to know that basis these estimates how do i obtain the probabilty of the event under consideration for each record ( i.e how to get the cross product of the x's and the beta's so that i can obtain the logit and get the probability)....

pls help Message was edited by: k745
deleted_user
Not applicable
Use the CLASS statement, and estimates for each category (i.e., level) will be interpreted against the highest level in that class variable (SAS default). With so many categories, you may run into estimation problems if each category does not include observations of both 0's and 1's. In this case, consider pooling categories in a meaningful way.

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