[R] lme: extract variance estimate

2004-07-06 Thread Stephen Ellner
For a Monte Carlo study I need to extract from an lme model the estimated standard deviation of a random effect and store it in a vector. If I do a print() or summary() on the model, the number I need is displayed in the Console [it's the 0.1590195 in the output below] >print(fit) >Linear mixe

[R] lme: extract variance estimate

2004-07-07 Thread Stephen Ellner
Spencer Graves wrote: > Have you considered "VarCorr"? I've used it with "lme", and the >documentation in package lme4 suggests it should work with GLMM, which >might also do what you want from glmmPQL. Thanks for the pointer (I was not aware that nlme and lme4 had different versions of

Re: [R] lme: extract variance estimate

2004-07-06 Thread Spencer Graves
Have you considered "VarCorr"? I've used it with "lme", and the documentation in package lme4 suggests it should work with GLMM, which might also do what you want from glmmPQL. hope this helps. spencer graves Stephen Ellner wrote: For a Monte Carlo study I need to extract from an lm

Re: [R] lme: extract variance estimate

2004-07-07 Thread Spencer Graves
I just tried it in both lme4 and nlme. I got it in nlme but not lme4. I'm sure lme4 is better in many ways, but I could not figure out how to get what you want in lme4. Specifically, I tried the following: DF <- data.frame(x=rep(letters[1:2], 2), y=rep(1:2, 2)+0.01*(1:4)) fit <- l

Re: [R] lme: extract variance estimate

2004-07-08 Thread Douglas Bates
I'm actually replying to Stephen's message but I had already deleted it before I read Spencer's message. (I'm on a slow connection and I am simultaneously downloading a big file so I am trying to optimize bandwidth, sometimes with unfortunate results.) In the previous message the author showed