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

I'm trying to run the proc genmod command, but when I look at level 3, it has 0s across the board but levels 1 and 2 have values. How do I get my level 3 data to show up or interpret them  I was told that this was the correct output for what Im trying to do and that I only need 2 estimates to calculate the 3rd but Im unsure of how to do that. Would level 1 be considered the intercept in this case? Would level 2 be considered level 1 and level 3 considered level 2? 

 

Data UGAStudent_DATA;
Set date_difference; 

if cd4 <= 200 then cd4_levels='1';
if cd4 >=201 <=500 then cd4_levels='2';
if cd4 > 500 then cd4_levels='3'; 
run;

proc genmod data= ugastudent_data;
class cd4_levels /param=glm ;
model  Factor1 =  cd4_levels n_Duration_on_ART_months ;  
run;

large.png

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

This is the default way that SAS (all procedures) handles categorical variables. There are different ways to parameterize the model, each with different coefficients, but each parameterization produces the same model and predictions. Under your parameterization, the value of the last level alphabetically (in your case, level 3) is set to zero. The true effect for level 1 is really intercept + level 1 coefficient = 7.76 + 0.3812, and so on.

 

Instead of trying to interpret the model coefficients of class variables, you probably want to use the LSMEANS command and interpret the LSMEANS values.

 

A better idea, in my opinion, is to treat CD4 as a continuous variable rather than as a class variable CD4_LEVELS.

--
Paige Miller

View solution in original post

7 REPLIES 7
PaigeMiller
Diamond | Level 26

This is the default way that SAS (all procedures) handles categorical variables. There are different ways to parameterize the model, each with different coefficients, but each parameterization produces the same model and predictions. Under your parameterization, the value of the last level alphabetically (in your case, level 3) is set to zero. The true effect for level 1 is really intercept + level 1 coefficient = 7.76 + 0.3812, and so on.

 

Instead of trying to interpret the model coefficients of class variables, you probably want to use the LSMEANS command and interpret the LSMEANS values.

 

A better idea, in my opinion, is to treat CD4 as a continuous variable rather than as a class variable CD4_LEVELS.

--
Paige Miller
UGAstudent
Calcite | Level 5

Thank you, 

 

Ive added in the lsmeans command. The lsmeans estimate represents severity of disease. So is the interpretation of the LsMeans simply that the higher the mean, the more severity occurs in that particular CD4 level? 

 

Screen Shot 2018-03-18 at 8.46.14 PM.png

PaigeMiller
Diamond | Level 26

@UGAstudent wrote:

Thank you, 

 

Ive added in the lsmeans command. The lsmeans estimate represents severity of disease. So is the interpretation of the LsMeans simply that the higher the mean, the more severity occurs in that particular CD4 level? 

 

Screen Shot 2018-03-18 at 8.46.14 PM.png


Yes, this is the estimated mean value of Factor1 based upon the level of CD4_LEVEL. You can also turn on other options in the LSMEANS statement to test whether or not the cd4_level values has statistically different means.

--
Paige Miller
Reeza
Super User

How do I get my level 3 data to show up or interpret them  I was told that this was the correct output for what Im trying to do and that I only need 2 estimates to calculate the 3rd but Im unsure of how to do that. 

 

 

To determine the effect for Level 1, everything else held constant:

Level1: Intercept + Level1

Level2: Intercept + Level2

Level3: Intercept

 

Here's a good write up on interpreting categorical/dummy variables that may help you understand it, especially if you work through it. 

https://stats.idre.ucla.edu/sas/webbooks/reg/chapter3/regression-with-saschapter-3-regression-with-c...

 

 

 

 

UGAstudent
Calcite | Level 5

Thank you! 

 

Im controlling for ART duration, so when interpreting for lets say level 1, im not also controlling for levels 2 and 3 since they are the same variable correct? 

PaigeMiller
Diamond | Level 26

@UGAstudent wrote:

Thank you! 

 

Im controlling for ART duration, so when interpreting for lets say level 1, im not also controlling for levels 2 and 3 since they are the same variable correct? 


I would say this is not correct.

 

There is no such concept of "controlling for" for dummy variables representing levels of a categorical variable.

--
Paige Miller
PaigeMiller
Diamond | Level 26

@Reeza wrote:

How do I get my level 3 data to show up or interpret them  I was told that this was the correct output for what Im trying to do and that I only need 2 estimates to calculate the 3rd but Im unsure of how to do that. 

 

 

To determine the effect for Level 1, everything else held constant:

Level1: Intercept + Level1

Level2: Intercept + Level2

Level3: Intercept

 

 


I would quibble with this -- I would say the following:

 

Level1: Intercept + Level1

Level2: Intercept + Level2

Level3: Intercept + Level3

--
Paige Miller

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