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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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