BookmarkSubscribeRSS Feed
Ivy
Quartz | Level 8 Ivy
Quartz | Level 8

Ivy_0-1684941957887.png

Hello, 

I am trying to write the contrast statement for race in reference coding schema:

black vs the average effect of the three levels (black vs (black + other + white)/3)

contrast 'race black vs (white black other)/3' race 2 -1 / estimate=all ;

The result seems not right.

 

May you please help with the statement?

Thanks!

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Hello,

 

I have moved your post to the "Statistical Procedures" board.

 

Why don't you use effect coding (aka deviation-from-the-mean coding) instead of reference-cell coding?
This deviation effect coding system compares the mean of the dependent variable for a given level to the grand mean of the dependent variable.  

 

Otherwise, see here:

Usage Note 24447: Examples of writing CONTRAST and ESTIMATE statements
https://support.sas.com/kb/24/447.html

 

Cheers,

Koen

SteveDenham
Jade | Level 19

If you shift to effect coding (as in PROC GLM), you can use the following LSMEAN statement to compare each level to the average of all levels.

 

lsmeans race/diff=ANOM;

The p values associated with this option are for the difference on the logit scale. If you want to get the difference on the original scale, you will likely need to use the %NLEst and %NLMeans macros, which will draw on @sbxkoenk comments about ESTIMATE statements.

 

SteveDenham

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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