[R-sig-ME] lmer, intercepts and offsets
Daniel Farewell
farewelld at cf.ac.uk
Tue Aug 14 18:39:02 CEST 2007
This is a follow-up to a thread from back in March ("lmer, intercepts and offsets"). I'm hoping (at least) to better understand how lmer works.
I'd like to "trick" lmer into thinking it has converged to certain parameter estimates. This is straightforward for variance components, making use of the 'start' parameter and using 'control' to set the number of the various kinds of iteration to zero.
My ultimate goal is to extract posterior second moments from a model "fit" where I have specified both the variance components and the fixed effects.
Obviously it is possible to dig inside the fitted model and manually alter the fixed effects, but this has no impact on the result of a call to ranef, presumably because the posterior means (and variances?) have already been calculated, and are sitting in the ranef slot of the fitted model.
My question is this: at what stage do the random effects get calculated? Simplifying greatly, at some stage lmer must calculate betahat(Omega) (the fixed effects) and ranef(Omega) (the estimated random effects) for the converged value of Omega. Does ranef(Omega) depend on the result of betahat(Omega)? If so, then presumably tinkering with the betahat(Omega) results at the appropriate point inside lmer would result in what I want. If not (that is, if the dependence on the fixed effects is indirect) what needs tinkering with?
Is there a good reason why lmer does not allow models with no fixed effects at all? With the right offset, this would be another way to achieve the same result.
I hope the above makes sense. Thanks in advance for any advice you can offer!
Daniel Farewell
More information about the R-sig-mixed-models
mailing list