Skip to content
Prev 10862 / 20628 Next

bug in refit function?

Ben Bolker <bbolker at ...> writes:
Conversation continues at https://github.com/lme4/lme4/issues/142

My last update on the subject:

This is a little trickier than I thought. It's easy enough to update
the response column in the internal model frame slot, but the question
is whether one should try to update all references to y1 (in the
example above) to Y[,2] -- this is necessary if we want the results to
work with update(), which just goes to the environment (not to the
stored model frame) to re-evaluate the whole model ... otherwise, we
can replace the relevant slot in the model matrix, but unless we
update the formula to Y[,2] ~ ..., updating will just re-evaluate the
whole model, pulling y1 from d (where it hasn't changed, and where we
wouldn't want to change it!) and hence getting the old value, rather
than from model.frame(fit2)