Tingting Zhan
2010-Dec-01 16:14 UTC
[R] [R-lme] Extract estimated variances from output of lme?
Hi all, I have the output of summary() of an lme object called "lme.exp1", for example #############################################> summary(lme.exp1)Linear mixed-effects model fit by REML Data: DATA Log-restricted-likelihood: -430.8981 Fixed: fixed.exp1 .... Random effects: Formula: ~-1 + mu1 + log.sig1 | animID Structure: Diagonal mu1 log.sig1 Residual StdDev: 2.605223 0.1013134 3.876431 Correlation Structure: General Formula: ~1 | animID/fieldN Parameter estimate(s): Correlation: 1 2 0.612 Variance function: Structure: Different standard deviations per stratum Formula: ~1 | type Parameter estimates: mu1 log.sig1 1.00000000 0.03722675 Number of Observations: 376 Number of Groups: 32 ############################################## If I want to reuse these estimates, I can use> summary(lme.exp1)$coefficients$fixed;to extract fixed effect estimates, and > summary(lme.exp1)$sigma for the common variance parameter sigma. But if I need the covariance estimates 0.612 and 0.0372, do I have a function to extract these numbers too? I'm looking for something similar to function ranef() [of course ranef() does not serve my purpose]. Any advice appreciated! Tingting [[alternative HTML version deleted]]
Ben Bolker
2010-Dec-01 19:46 UTC
[R] [R-lme] Extract estimated variances from output of lme?
Tingting Zhan <tingting.zhan <at> jefferson.edu> writes:> > Hi all, > > I have the output of summary() of an lme object called "lme.exp1", for > example > > ############################################# > > summary(lme.exp1) >[snip]> for the common variance parameter sigma. But if I need the covariance > estimates 0.612 and 0.0372, do I have a function to extract these numbers > too? I'm looking for something similar to function ranef() [of course > ranef() does not serve my purpose]. Any advice appreciated! > > Tingting?VarCorr and str(VarCorr(lme.exp1)) to figure out how to extract the values you want (it's a slightly odd object, a matrix of mode 'character' with labels interspersed with numeric values ...) r-sig-mixed-models is probably the best list for this sort of query ...
Seemingly Similar Threads
- The gradient of a multivariate normal density with respect to its parameters
- problem with ML estimation
- How to determine sensible values for 'fnscale' and 'parscale' in optim
- definition of "dffits"
- About: Error in FUN(X[[1]], ...) : symbol print-name too long