[R] [R-lme] Extract estimated variances from output of lme?

2010-12-01 Thread Tingting Zhan
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. 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]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [R-lme] Extract estimated variances from output of lme?

2010-12-01 Thread Ben Bolker
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 ...

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.