I'm trying to extract a parameter from a model fit by ML which has a correlation structure obtained from corPagel (defined in package ape). The parameter of interest is within the element named apVar in the summary.
library(ape); library(nlme)
cor_lambdaML <- corPagel( 1, avestree, fixed=FALSE )
m <- gls(AUTUMN ~ GREGARIOUSNESS + SEASON + TARSUS + MATURATION + SPRING + MIGRATION + DICHROMATISM + HABITAT + POSTJUVENILE + CONSPICUOUSNESS, correlation = cor_lambdaML, data = avesdata, method = 'ML' )
names(m)
m$apVar
This code produces the following output (please, download a dput with model m here):
corStruct lSigma
corStruct 0.03848807 0.03090663
lSigma 0.03090663 0.04403168
attr(,"Pars")
corStruct lSigma
0.858126838 0.008131981
attr(,"natural")
[1] TRUE
Extracting values of the first matrix is trivial, but how can I extract the value of corStruct within the element attr(, "Pars")?