[R-lang] Contrast Coding in R Regressions

Rachel Baker rachelbaker2010 at u.northwestern.edu
Tue Sep 15 21:16:54 PDT 2009


Hi,

I've recently started using R to do regressions, using the 'lmer' function.
I am currently re-running some analyses that originally had treatment
coding, so that they now have contrast coding.  My question is about how to
interpret contrast coded regression outputs.

One of my independent variables (nativeLanguage) has 3 levels: English,
Chinese, and Korean.  As this experiment was conducted in English,
participants in the English group were native speakers, and participants in
the other two groups were non-native speakers.  In my original
treatment-coded analysis, English was the reference level.  My output for
e.g. 'langCompare.lmer = lmer(duration~nativeLanguage+(1|Subject),
data=myData)' had lines like:

                                                 Estimate Std. Error t value
nativeLanguageChinese              0.025920   0.002384  10.872
nativeLanguageKorean                -0.004416   0.002091  -2.112

As I understood it, such lines gave information about the comparison between
Chinese and English, and between Korean and English, respectively.

I contrast coded this variable with the code:
'contrasts(myData$nativeLanguage) = c(-1, .5, .5)' (after ordering the
levels: English, Chinese, Korean).  This was in order to compare the native
(English) group to the non-native (Chinese and Korean) groups.  After this
contrast coding, my output had lines like:

                                        Estimate Std. Error t value
nativeLanguage1               0.10002   0.010113  11.242
nativeLanguage2
-0.00046   0.639887  1.388

I was wondering how to interpret this output.  My guess is that
nativeLanguage1 is the comparison between the native and non-native groups,
and native_language2 is the comparison between Chinese and Korean, but I
haven't been able to find any resources to confirm this.

I would greatly appreciate any advice on how to interpret regressions after
contrast coding, or pointers to appropriate resources on this topic!

Thanks very much,
Rachel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.ucsd.edu/pipermail/r-lang/attachments/20090915/4dcd6094/attachment.htm>


More information about the R-lang mailing list