I agree that the linked blog explains things well, but isn't it unorthodox
to distinguish "sum coding" and "deviation coding"? I thought the two terms
were usually synonyms.

And if they are to be distinguished, it struck me as odd that +0.5/-0.5 was
being labelled "deviation coding", when as the blog shows, it's actually
under +1/-1 coding that the coefficients represent the deviations of each
group from the grand mean.

Dan

On 11 Apr 2015, at 23:22, Dan McCloy <[email protected]> wrote:

Hi Sunfa,

regarding your question #1: There is a good explanation of the difference
between -1/+1 and -0.5/+0.5 coding on Dale Barr's blog:
http://talklab.psy.gla.ac.uk/tvw/catpred/

regarding your question #3: As far as I know there is no built-in function
for the -0.5/+0.5 coding scheme. You can achieve it either by specifying
the contrast matrix yourself, or by setting contr.sum() and then dividing
by 2:

contrasts(foo) <- contr.sum
contrasts(foo) <- contrasts(foo) / 2

regarding your question #2, what is preferred is likely to vary by
researcher, and probably depends on what your research question is,
although the aforementioned blog post offers some reasons to prefer the
-0.5/+0.5 scheme.

-- dan

Daniel McCloy
http://dan.mccloy.info/
Postdoctoral Research Fellow
Institute for Learning and Brain Sciences
University of Washington


On Sun, Apr 12, 2015 at 10:08 AM, Sunfa Kim <[email protected]> wrote:

> Dear R users,
>
> I would like to ask questions regarding the process of simplifying random
> effects structures in mixed logit models, and the deviation coding.
>
> I have an independent variable with four levels and a participant variable
> with numerical values as my two predictor variables. My data are
> categorical data and so I used mixed logit models (Jaeger, 2008).
>
> In my experiment, I examined if structural priming would interact with
> bilinguals' L2 proficiency. The participant variable (i.e., bilinguals' L2
> proficiency) was centered to its mean before it was included in the model.
>
> Prime Type    Active Passive Unaccusative intransitive Unergative
> intransitive  Active target responses          Passive target responses
>
> I followed the "Keep it maximal" standard proposed by Barr, Levy,
> Scheepers, and Tily (2013). But, the model with the maximal random effects
> structure failed to converge. Barr et al. suggested two ways to simplify
> the maximal random effects structure when it fails to converge.
>
> (1) remove correlation parameters
>
> TargetResponse~PrimeType*L2Proficiency+(1 | Subject)+(0+PrimeType |
> Subject)+(1 | Item)+(0+PrimeType*L2Proficiency | Item)
>
>
> (2) Remove random intercepts for any within-unit
>
> TargetResponse~PrimeType*L2Proficiency+(0+PrimeType |
> Subject)+(0+PrimeType*L2Proficiency | Item)
>
> Now, Barr et al. warned that, with these simplified models, the treatment
> coding vs. the deviation coding will make difference, with the deviation
> coding performing generally better.
>
> Throughout the analyses, I have been using the treatment coding of (0 and
> 1), and I would like to re-code the "Prime Type" with the deviation coding.
> In Barr et al.'s article, the deviation coding is introduced as (-.5 and
> .5).
>
> <***Question 1***> Will the deviation coding of (-.5 and .5) be different
> from the deviation coding of (-1 and 1)? In other words, when the "-.5 and
> .5" coding is used, will it yield different results from the "-1 and 1"
> coding?  If so, why?
>
> <***Question 2***> Which deviation coding is preferred for data analyses?
>
> <***Question 3***> If the (-.5 and .5) coding is preferred over the (-1
> and 1) coding, is there a R built-in function for the "-.5 and .5" coding?:
>
> contr.sum(4)
>
> The above R built-in function provides the (-1 and 1) coding. I am
> wondering if there is a R built-in function for the (-.5 and .5) coding?
>
> Thank you very much for any advice you may have on the above questions.
>
> Warmest regards,
> Sunfa Kim
>

Reply via email to