Sundar's advice seems to do the trick. Here is a small simulation of a
cross-classified random model with extraction of the fitted variance
components from lme:
library(nlme)
set.seed(18112003)
na - 20
nb - 20
sigma.a - 2
sigma.b - 3
sigma.res - 1
mu - 0.5
n - na*nb
a - gl(na,1,n)
b
Many thanks for help from Peter Dalgaard, Douglas Bates and Bill Venables.
As a result of their help, here is a working example of using lme to fit an
additive random effects model. The model here is effectively y~a+b with a
and b random:
y - rnorm(12)
a - gl(4,1,12)
b - gl(3,4,12)
u -
Gordon Smyth [EMAIL PROTECTED] writes:
On page 165 of Mixed-Effects Models in S and S-Plus by Pinheiro and
Bates there is an example of using lme() in the nlme package to fit a
model with crossed random factors. The example assumes though that the
data is grouped. Is it possible to use lme()
Peter Dalgaard [EMAIL PROTECTED] writes:
Gordon Smyth [EMAIL PROTECTED] writes:
On page 165 of Mixed-Effects Models in S and S-Plus by Pinheiro and
Bates there is an example of using lme() in the nlme package to fit a
model with crossed random factors. The example assumes though that the
Douglas Bates [EMAIL PROTECTED] writes:
(Sorry, I'm a little rusty on the syntax, but just follow the example
in PB)
AFAIR, it also works with random=list(a=~1,one=~b) and vice versa.
Not sure about that.
Sorry. It's certainly not correct as written. It has to be something like
Douglas Bates [EMAIL PROTECTED] writes:
...
I realize that it is awkward to use lme to fit models with crossed
random effects. As Saikat DebRoy and I described in a recent preprint
http://www.stat.wisc.edu/~bates/reports/MultiComp.pdf
we now have a good handle on the computational