Re: [R] cross-classified random factors in lme without blocking - success

2003-11-22 Thread Gordon Smyth
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

Re: [R] cross-classified random factors in lme without blocking

2003-11-14 Thread Gordon Smyth
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 -

[R] cross-classified random factors in lme without blocking

2003-10-31 Thread Gordon Smyth
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() to fit crossed random factors when the

Re: [R] cross-classified random factors in lme without blocking

2003-10-31 Thread Peter Dalgaard
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()

Re: [R] cross-classified random factors in lme without blocking

2003-10-31 Thread Douglas Bates
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

Re: [R] cross-classified random factors in lme without blocking

2003-10-31 Thread Peter Dalgaard
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

Re: [R] cross-classified random factors in lme without blocking

2003-10-31 Thread Douglas Bates
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