Skip to content
Prev 167504 / 398502 Next

reference category for factor in regression

Hi Jos,

you can force R to set contrasts for factors the way you like them with 
contrasts(). You seem to be thinking of treatment contrasts, which are 
most easily interpreted, but there are also others.

However: are you sure you want to bin an age variable into categories? 
You will lose power, along with a lot of other unpleasant things:
http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/CatContinuous

With five categories, you are giving up 4 df. I'd recommend looking into 
splines, where you should be able to get more bang for the buck. Look at 
rcs() in the Design package, and at Frank Harrell's excellent book 
"Regression Modeling Strategies".

Of course, if you only have the binned data, all this is irrelevant...

HTH,
Stephan


Jos Elkink schrieb: