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

In Generalized liner model,  there are totally 120 categorical variables  as predictorsand each of them have 20 levels. I tried to convert these categorical variables into continuous variables so that I can build the model; however, I did not know how to do so.

Who knows? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Obviously, the categories need to be ordinal so that you can order them. Maybe you have levels such as "bad", "ok", "good", and "excellent"? The way that you convert these to numbers will affect your answer. You can recode those levels as 1,2,3,4, or you might decide that "bad" and "excellent" have more extreme values, and so you recode as 0, 2,3,5.

There is some terse discussion of this in the doc for the SCORES statement of the FREQ procedure:

http://support.sas.com/documentation/cdl/en/procstat/63963/HTML/default/viewer.htm#procstat_freq_a00...

For a technical consideration of whether you should do this, along with instructions how, see Analysis of Ordinal Categorical Data by Alan Agresti. You can also try an internet seach using terms such as Ordinal Categories Rank Ridit Scores.

View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

Without seeing the code you are using to do the analysis, I hesitate to offer a solution.  However, it could be as simple as not including the predictors in the class statement, provided the variables have a natural ordering.  Also, why do you have to convert to build the model?  Both PROC GLIMMIX and PROC GENMOD can fit categorical models.  If you are thinking of some sort of stepwise model building, please look at http://communities.sas.com/thread/30130?tstart=0, where some strong caveats are presented.

Good luck.

Rick_SAS
SAS Super FREQ

Obviously, the categories need to be ordinal so that you can order them. Maybe you have levels such as "bad", "ok", "good", and "excellent"? The way that you convert these to numbers will affect your answer. You can recode those levels as 1,2,3,4, or you might decide that "bad" and "excellent" have more extreme values, and so you recode as 0, 2,3,5.

There is some terse discussion of this in the doc for the SCORES statement of the FREQ procedure:

http://support.sas.com/documentation/cdl/en/procstat/63963/HTML/default/viewer.htm#procstat_freq_a00...

For a technical consideration of whether you should do this, along with instructions how, see Analysis of Ordinal Categorical Data by Alan Agresti. You can also try an internet seach using terms such as Ordinal Categories Rank Ridit Scores.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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