BookmarkSubscribeRSS Feed
Jamelle
Calcite | Level 5


I have been working on a SAS code for 3 weeks in which I am trying to run multinomial logistic regression, with no luck.  I think the challenge for me is that all of my variables have been coded as dummy variables and I am having a problem writing the code placing variables into classes.  Please help...

2 REPLIES 2
AncaTilea
Pyrite | Level 9

Hi.

Your question is not all that well written.

So, do you have something like this?

PROC GENMOD DATA = YOUR_DATA;

     MODEL Y = DUMMY_1 DUMMY_2 DUMMY_3 X1 X2 X3;

RUN;QUIT;

and you want something like this?

PROC GENMOD DATA = YOUR_DATA;

CLASS CATEG_VAR;

     MODEL Y = CATEG_VAR X1 X2 X3;

RUN;QUIT;

So, let's say you have 2 dummy variable for race: Dummy_White, Dummy_Black, and no Dummy for "Other" group.

You woudl like to create a RACE variable something like this?

if Dummy_White = 1 then RACE = "White";

else if Dummy_Black = 1 then RACE = "Black";

else Race = "Other";

Then you run your model with CLASS Race and so on...

So, am I going in the right direction with what you need...or neah?

Smiley Happy

1zmm
Quartz | Level 8

Multinomial logistic regression implies a nominal dependent variable.  Anca tilea suggested a reasonable approach for combining separate dummy variables into one variable, though the emphasis was on independent variables, not dependent variables.  In that example, the single variable, Race, would have multiple values and would be used as the DEPENDENT variable.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1842 views
  • 0 likes
  • 3 in conversation