[R-sig-ME] lme and prediction intervals
Ben Bolker
bolker at ufl.edu
Mon Apr 5 03:54:18 CEST 2010
Douglas Bates wrote:
> On Sat, Apr 3, 2010 at 11:12 PM, D Chaws <cat.dev.urandom at gmail.com> wrote:
>> Ok, issue solved for the most straightforward random effects cases.
>> Not sure about nested random effects or more complex cases.
>
> Assuming that you can make sense of lsmeans in such a case. You may
> notice that lsmeans are not provided in base and recommended R
> packages. That isn't an oversight. Try to explain what lsmeans are
> in terms of the probability model.
>
> Anyway, if you are happy with it, then go for it. I'll just give you
> a warning from a professional statistician that they are a nonsensical
> construction.
lsmeans may not make sense in general (I don't really know, I have a
somewhat weird background that mostly doesn't include SAS), but there's
nothing wrong with wanting predictions and standard errors of
predictions, which be definable (?) if one can specify (a) whether a
given random effect is set to zero or included at its conditional
mean/mode value (or, for a simulation, chosen from a normal distribution
with the appropriate variance-covariance structure (b) whether random
effects not included in the prediction (and the residual error) are
included in the SE or not. I agree that specifying all this is not as
easy as specifying "level", but can't one in principle do this by
specifying which random effects are in/out of the prediction or the SE?
My hope is that, after building code for a reasonable number of
examples, the general principles will become sufficiently clear that a
method with an appropriate interface can then be written (note use of
the passive voice). The hardest part I discovered for doing this with
existing lme and lme4 objects is recalculating the random-effects design
matrix appropriately when a new set of data (with different
random-effects factor structure) is specified ...
Ben Bolker
More information about the R-sig-mixed-models
mailing list