[R] Updating lmer - object is not subsettable?
Jarrett Byrnes
jebyrnes at ucdavis.edu
Wed Sep 13 06:10:49 CEST 2006
Of course. The traceback is as follows. If you wish, I can
privately email you the data, as well as the function I'm working on.
17: all.names(x)
16: inherits(x, "factor")
15: is.factor(table)
14: match(x, table, nomatch = 0)
13: "/" %in% all.names(x)
12: slashTerms(x[[3]])
11: FUN(X[[1]], ...)
10: lapply(bb, function(x) {
if (is.list(trms <- slashTerms(x[[3]])))
return(lapply(unlist(makeInteraction(trms)), function
(trm) substitute(foo |
bar, list(foo = x[[2]], bar = trm))))
x
})
9: unlist(lapply(bb, function(x) {
if (is.list(trms <- slashTerms(x[[3]])))
return(lapply(unlist(makeInteraction(trms)), function
(trm) substitute(foo |
bar, list(foo = x[[2]], bar = trm))))
x
}))
8: expandSlash(findbars(formula[[3]]))
7: lmer(formula = sim.data ~ (1 | Trial), data = exp.data, method =
"ML")
6: lmer(formula = sim.data ~ (1 | Trial), data = exp.data, method =
"ML")
5: eval(expr, envir, enclos)
4: eval(call, parent.frame())
3: .local(object, ...)
2: update(model.2, sim.data ~ .)
1: update(model.2, sim.data ~ .)
On Sep 12, 2006, at 8:16 PM, Douglas Bates wrote:
> Can you show a traceback on this example? It may be related to a
> problem that I just fixed in the development version of the lme4
> package.
>
> Alternatively if you can make the data available I can generate a
> traceback myself.
>
>
> On 9/12/06, Jarrett Byrnes <jebyrnes at ucdavis.edu> wrote:
>> I'm attempting to write a general function to implement Faraway's
>> bootstrapping algorithm for mixed models with lmer, but have run into
>> a curious problem. I'm comparing two models
>>
>> model.1<-lmer(Response ~ Treatment + (1|Trial), data=exp.data,
>> method="ML")
>> model.2<-lmer(Response ~ 1 + (1|Trial), data=exp.data, method="ML")
>>
>>
>> When I attempt to update model.2 with simulated data, however, I get
>> the following error:
>>
>> sim.data<-unlist(simulate(model.1))
>> sim.model.2<-update(model.2, sim.data~.)
>>
>> Error in x[[3]] : object is not subsettable
>>
>>
>> Now, the following
>> sim.model.1<-update(model.1, sim.data~.)
>>
>> appears to work just fine. Does anyone know why update won't work,
>> and is there something I can do about this?
>>
>> -Jarrett
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
More information about the R-help
mailing list