[R-lang] Re: p-values for mixed effects models with random slopes

Finlayson, Ian IFinlayson@qmu.ac.uk
Tue Jan 18 04:23:36 PST 2011


I was aware that pvals.fnc works with random slopes where you don't
impose a correlation, however I don't believe that centering will remove
the correlation (in fact when I tested it with the sleepstudy data, the
correlation increased!).

You could always compare a model with (1+x|Subject) and one with
(0+x|Subject), and if there's no difference then you can go with the
latter and use pvals.fnc. Although obviously this isn't ideal if there
is a difference (and/or you have reason to believe a correlation should
exist and have a fixed design).

Ian

-----Original Message-----
From: ling-r-lang-l-bounces+ifinlayson=qmu.ac.uk@mailman.ucsd.edu
[mailto:ling-r-lang-l-bounces+ifinlayson=qmu.ac.uk@mailman.ucsd.edu] On
Behalf Of Jonathan Baron
Sent: 18 January 2011 11:52
To: Steven Piantadosi
Cc: r-lang@ling.ucsd.edu
Subject: [R-lang] Re: p-values for mixed effects models with random
slopes

The lme4a package has a bootMer function, which may be what you want
to do.  (I cannot figure out what it does, from the documentation.)

On the original question of pvals.fnc() with random slopes, the last
time I checked, the problem was that it could not handle correlated
random effects.  Thus
l1 <- lmer(y ~ x + (1+x|subject))
would not work, but
l2 <- lmer(y ~ x + (1|subject) + (0+x|subject))
would work in pvals.fnc().  l2 assumes no correlation between the
slope and intercept (I think).

The output of l1 will show you the correlation (I think).  And you can
make it disappear (I think) by centering x for each subject on the
mean for that subject.  Or you can reduce it to a low number by
centering on something else, such as the grand mean.  Or it may be
pretty low without any transformation.  Or it might not matter much,
so long as it isn't really high.

Obviously all this is pretty uncertain, so I hope someone will set me
straight if it is wrong.

Jon

On 01/18/11 00:19, Steven Piantadosi wrote:
> Hi All,
> 
> Unless I'm out of date, p values are broken on glmer too? I wonder if
an
> easy solution to these two problems might be to implement a
> bootstrapping/resampling algorithm on mixed effect regressions. Does
> anyone know about this--would it be conservative or anticonservative
or
> a problem on data sets of typical size in psycholinguistics? 
> 
> If this is actually a good idea, and someone could point me to a
> reference on how bootstrapping would work on such models (I know
> references for simple non-mixed effect regressions, but not how
> bootstrapping interfaces with repeated subject/item measurements and
> random effects), I'd be happy to try to put some friendly code
> together. 
> 
> ++Steve
> 
> > pvals.fnc works for models that have random intercepts, but not for 
> > models with random slopes.  My question is whether anyone has 
> > implemented something analogous to pvals.fnc for models with random 
> > slopes. 

-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron



More information about the ling-r-lang-L mailing list