BookmarkSubscribeRSS Feed
hwkim286
Calcite | Level 5

Hello all.

I've been trying to run proc glm using categorical variables like gender and education level.

For some reason, the last outcome for each categorical variable are not printing. (0 for estimate and missing for others) 

http://support.sas.com/kb/22/590.html The first two tables in this link show the same thing for type webster and block 3.

Is there a way to code to make sure that all the outcome for categorical variables show? I know for sure that there are values through proc freq. For instance, when using gender as a categorical variable, I am getting estimates for male but not for female (male = 1 and female = 2). For education level I am getting estimates for low but not high (low = 1 and high = 2).

 

My code is something like this. (only variable names are different)

 

proc glm data = final_data;

        class ID gender;

        model exercise = gender education_level/ noint solution;

run;

 

I've tried noint and got the estimates for the first class variable. However the second class variable is still not showing an output value for the estimate.

 

Thank you in advance.

1 REPLY 1
PGStats
Opal | Level 21

This is called Reference parameterization. The last level from each class effect is fixed at zero and the other levels are estimated as offsets from that reference. So zero really is the estimate for that last class level.

You would probably find LSMEANS more informative. Add

 

LSMEANS gender;

LSMEANS education_level;

 

say, to your proc glm code and see if those results are more interesting to you. There are also plenty of options that can be added to the LSMEANS statement.

 

 

PG

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 519 views
  • 0 likes
  • 2 in conversation