[R] Setting up contrasts

About this list Date view Thread view Subject view Author view Attachment view

From: David J. Netherway (david.netherway@adelaide.edu.au)
Date: Mon 03 May 2004 - 18:25:12 EST


Message-id: <409601E8.4A7637B6@adelaide.edu.au>

I am using the following model:
lm <- lm(mydata[[variableName]] ~ Age + Gender + Group, data=mydata)

There are 5 groups in "Group": nonc (the control), c1,c2,c3 and c4.

How do I contrast nonc vs the others?

and

How do I contrast c1 vs other c's (ie c2,c3,c4 as a subgroup)?

I have looked at the contrasts option in lm and model.matrix and am
really none the wiser.
Though it looks like I need to read up on model matrices again.

Any help would be appreciated.

Thanks, David

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:07 EST