On 22/04/2008, at 11:59 AM, Paul Lynch wrote:

> Is there a way in R to control how factors are coded?  It looks like
> reference cell coding is used by default.  Is there a way to get
> effects coding?
>
> (I could just set up the factor dummy variables as I wish and use lm,
> but I'm wondering if there is a better way.)

I think you want to consider contrasts.  You probably want to do

        options(contrasts=c("contr.sum","contr.poly")

or

        options(contrasts=c("contr.helmert","contr.poly")


                cheers,

                        Rolf Turner


######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to