[R] Help with lsmeans

Ben Bolker bbolker at gmail.com
Tue Aug 26 23:07:22 CEST 2014


Dan Dillon <dgdillon <at> gmail.com> writes:

> 
> Colleagues:
> 

 [snip]

> 
> My data are from a behavioral experiment in which two groups of subjects
> complete 200+ trials of a task with two conditions. Each subject is tested
> in one of four separate locations. I record accuracy (0 or 1) and response
> time (RT) on each trial--these are the DVs for the two regressions. Thus,
> my dataframe has columns "location", "group", "subject", "trial",
> "condition", "accuracy", and "RT".
> 
> The regression model for accuracy looks like this:
> 
> acc.fm = glmer(accuracy ~ location + group*condition + (1|subject),
> family=binomial, data=my_data)
> 
> The results look as expected and I'm using lsmeans to do some follow-up
> analyses. For example, to compare accuracy by group and condition, I'm
> doing this:
> 
> acc.lsm <- lsmeans(acc.fm, ~group|condition)
> 
> pairs(acc.lsm)
> 
>

 [snip]

> Here is my model for the RT data
> (RT is a continuous variable so no logistic regression here):
> 
> rt.fm = lmer(rt ~ location + group*condition*accuracy + (1|subject),
> data=my_data)
> 
> The results from this regression look fine, but if I try this . . .
> 
> rt.lsm <- lsmeans(rt.fm ~ group|condition)
> 
> . . . or if I try to specify a reference grid like this . . .
> 
> rt.rg <- ref.grid(rt.fm)
> 
> . . . my machine hangs.
> 

  [snip]

  It's a little hard to say without a reproducible example, and
this question would probably be slightly more appropriate for
r-sig-mixed-models at r-project.org (although I can't actually tell
for sure whether it is an lme4-specific problem or a more general
ls.means::ref.grid question), but: how big a reference is ref.grid()
trying to construct?  Is it fairly high-resolution/high-dimensional?
I would probably try some experiments with small subsets of your data
to see how the results scale.



More information about the R-help mailing list