[R-sig-ME] models with no fixed effects
farewelld at Cardiff.ac.uk
Fri Sep 12 17:48:35 CEST 2008
I've read with interest the various arguments for and against models with no fixed effects! My
motivation for fitting such models was actually rather mundane, and hopefully uncontroversial: I
want to evaluate various fit-related quantities at fixed values of the parameters.
The kind of thing I'm after can be illustrated in an OLS context:
Generating some data with
y <- rnorm(50)
and fitting a no-fixed-effects model as
lm(y ~ 0)
works fine. Now this model isn't much use in itself, but we could use fits of this kind to plot a
profile likelihood for the mean by running
plot(b <- seq(-1, 1, 0.1), sapply(b, function(x) logLik(lm(y ~ 0, offset = rep(x, 50)))))
I hope this constitutes an example of a "useful" no-fixed-effects model?
In principle, things like logLik, predict and ranef are functions of the model, data and parameters.
In practice, they take model fits as arguments, so I guess what I really want is a way to "fake" a
model fit -- to pretend that lm or lmer has converged to a particular set of values. Using an offset
with lm, and no fixed effects, is equivalent to forcing some of the parameters to be what I want,
though the residual variance is still estimated.
In lmer (or lm, or glm, or ...), I'd love to be able to specify values for some, or all, of the
parameters, and then tell the fitting function not to update these parameters. We could then get the
quantities we want computed as a byproduct, in my case the posterior estimated random effects. Other
possible uses of this kind of functionality would be likelihood plots like the one above, or
numerical differentiation of the likelihood with respect to a parameter.
Is such a thing reasonable? Am I oversimplifying?
Very many thanks,
More information about the R-sig-mixed-models