[R-lang] Re: Removing the correlation parameter
Dale Barr
dale.barr@glasgow.ac.uk
Wed Jul 31 16:29:30 PDT 2013
Hi Zhenguang,
I don't have time to give more than a quick reply, but what you are seeing is some weirdness with how variables defined as data type "factor" behave in regression models. You seem to have four levels of Prime, and if you remove the correlations between the levels you should have three slopes. So, neither syntax is giving you the right answer! What you can do in this case is just explicitly define three separate dummy variables, eg. PrimeC, PrimeE, PrimeF, and then explicitly spell out (0 + PrimeC | Subject) + (0 + PrimeE | Subject) etc..
-Dale
Sent from Samsung Mobile
-------- Original message --------
From: Zhenguang Cai <zhenguangcai@gmail.com>
Date: 30/07/2013 13:23 (GMT+00:00)
To:
Cc: "<ling-r-lang-l@mailman.ucsd.edu>" <ling-r-lang-l@mailman.ucsd.edu>
Subject: [R-lang] Removing the correlation parameter
Hi all,
Barr et al. (2013) recommended a design-driven (i.e., maximal random
structure) approach for LME. However, as some of you may have
experienced, LME with maximal random structure on categorical data would
often result in non-convergence. Barr et al. recommended, in these
cases, removing the correlation parameter (i.e., correlation between a
random intercept and the corresponding random slope). However, I found
that Barr et al. (e.g., p.262, Table 1) and Baayen et al. (2008, p.395)
used different R scripts to do this. I wonder which is the correct way
to do. I use my own example below.
Barr et al: (But still correlations between levels of the fixed
predictor in the results)
Generalized linear mixed model fit by the Laplace approximation
Formula: ResponseC ~ Prime + (1 | Subject) + (0 + Prime | Subject) + (1
| Item) + (0 + Prime | Item)
Data: E1
AIC BIC logLik deviance
798.3 876.1 -382.1 764.3
Random effects:
Groups Name Variance Std.Dev. Corr
Subject PrimeC 1.2124e+00 1.1011e+00
PrimeE 1.4114e+00 1.1880e+00 0.583
PrimeF 1.2177e+00 1.1035e+00 0.737 0.979
Subject (Intercept) 1.7926e-02 1.3389e-01
Item PrimeC 2.1542e-09 4.6413e-05
PrimeE 4.6549e-02 2.1575e-01 -0.001
PrimeF 3.3489e-03 5.7870e-02 0.000 1.000
Item (Intercept) 2.7090e+00 1.6459e+00
Number of obs: 720, groups: Subject, 35; Item, 24
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.2973 0.4257 -0.698 0.4849
PrimeE 0.5507 0.3044 1.809 0.0705 .
PrimeF 1.3644 0.2787 4.896 9.8e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) PrimeE
PrimeE -0.348
PrimeF -0.350 0.674
Baayen et al: (here the correlations are gone)
Formula: ResponseC ~ Prime + (1 | Subject) + (1 | Prime:Subject) + (1
| Item) + (1 | Prime:Item)
Data: E1
AIC BIC logLik deviance
781.7 813.7 -383.8 767.7
Random effects:
Groups Name Variance Std.Dev.
Prime:Subject (Intercept) 0.16358 0.40445
Prime:Item (Intercept) 0.00000 0.00000
Subject (Intercept) 1.02334 1.01160
Item (Intercept) 2.62534 1.62029
Number of obs: 720, groups: Prime:Subject, 105; Prime:Item, 72; Subject,
35; Item, 24
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.2984 0.4196 -0.711 0.4769
PrimeE 0.5401 0.2595 2.081 0.0374 *
PrimeF 1.3539 0.2605 5.197 2.03e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) PrimeE
PrimeE -0.334
PrimeF -0.336 0.54
Thanks,
Zhenguang Cai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucsd.edu/pipermail/ling-r-lang-l/attachments/20130801/809f99b1/attachment-0001.html
More information about the ling-r-lang-L
mailing list