# [R-sig-ME] Problem with pvals.fnc with lmer fit (random correlation)

wphantomfr wphantomfr at gmail.com
Fri Feb 11 12:16:28 CET 2011

```Hi all mixed-model professionals :-)

I'm working on reaction time data (cognitive psychology). I only
recently started using mixed-effects and (1) was quite unsure about
setting up a model and (2) encounter a little problem.

Here is my design : participants (SUJET) have to detect a target sound
in different melodies called "CHANSON". each SUJECT is afffected to one
of four hearing CONDITION groups.  of course CONDITION is the fixed
factor of interest (4 levels). futher more I have a variable which is
coding the trial number in which was presented the item (variable ESSAI,
randomised between subjects) My dependant variable is reaction time (RT)

After graphical examination of the data I started to fit several lmer
with increasing complexity.

lmer1 = lmer(TR ~ CONDITION +(1|SUJET), data = propre) # fixed effect
and participant as rando fx
lmer2 = lmer(TR ~ CONDITION +(1|CHANSON)+(1|SUJET), data = propre) # add
item (CHANSON) as random fx
lmer3 = lmer(TR ~ CONDITION +(1|CHANSON)+(1|SUJET)+(1|ESSAI), data =
propre) # add ESSAI (trial number) as random fx
lmer4 = lmer(TR ~ CONDITION +(CONDITION|CHANSON)+(1|SUJET), data =
propre) #add a slope to CHANSON accross CONDITION

comparing the fits with anova seems to indicate tha lmer4 is better than
lmer3.
but the problem is when I want to estimates p-values for fixed effects
with :

mcmc = pvals.fnc(lmer4, nsim = 10000)

I get :
>  MCMC sampling is not yet implemented in lme4_0.999375
>   for models with random correlation parameters

After searching in r-help and here I have seen a post that proposed that
specifying the model with

lmer5 = lmer(TR ~ CONDITION
+(1|CHANSON)+((0+CONDITION)|CHANSON)+(1|SUJET), data = propre)

should work in pvals.fnc.... But no luck....

So, here are my questions :
1) is lmer4 a meaningful model for my data ? (and the previous ones ?)
2) if yes, is there a way to get the p-values for the fixed effets ?

complementary question : Is there a simple way to plot residuals for the
model ?

Thanks in advance for any help

Sylvain Clément
Neuropsychology & Auditory Cognition Team

```