Hi, I have been dabbling with str() to extract values from outputs such as lmer etc and have found it very helpful sometimes. but only seem to manage to extract the values when the output is one simple table, any more complicated and I'm stumped :-( take this example of the extracted coeficients from a lmer analysis... using str(coef(lmer(resp3~b$age+b$size+b$pcfat+(1|sex), data=b))) yields Formal class 'lmer.coef' [package "Matrix"] with 3 slots ..@ .Data :List of 1 .. ..$ :`data.frame': 2 obs. of 4 variables: .. .. ..$ (Intercept): num [1:2] 1.07 1.13 .. .. ..$ b$age : num [1:2] 0.00702 0.00702 .. .. ..$ b$size : num [1:2] 0.0343 0.0343 .. .. ..$ b$pcfat : num [1:2] 0.0451 0.0451 ..@ varFac: list() ..@ stdErr: num(0) how do I "get inside" the first table to get the value 1.07 for instance? Any help much appreciated. Simon Pickett PhD student Centre For Ecology and Conservation Tremough Campus University of Exeter in Cornwall TR109EZ Tel 01326371852
On Tue, Feb 27, 2007 at 03:52:54PM -0000, Simon Pickett wrote:> Hi, > > I have been dabbling with str() to extract values from outputs such as > lmer etc and have found it very helpful sometimes. > > but only seem to manage to extract the values when the output is one > simple table, any more complicated and I'm stumped :-( > > take this example of the extracted coeficients from a lmer analysis... > > using str(coef(lmer(resp3~b$age+b$size+b$pcfat+(1|sex), data=b))) yields > > Formal class 'lmer.coef' [package "Matrix"] with 3 slots > ..@ .Data :List of 1 > .. ..$ :`data.frame': 2 obs. of 4 variables: > .. .. ..$ (Intercept): num [1:2] 1.07 1.13 > .. .. ..$ b$age : num [1:2] 0.00702 0.00702 > .. .. ..$ b$size : num [1:2] 0.0343 0.0343 > .. .. ..$ b$pcfat : num [1:2] 0.0451 0.0451 > ..@ varFac: list() > ..@ stdErr: num(0) > > how do I "get inside" the first table to get the value 1.07 for instance? > > Any help much appreciated. >may `unlist' would be enough?
mod <- lmer(resp3~b$age+b$size+b$pcfat+(1|sex), data=b) coef(mod)[1]$Subject[1,1] r-help-bounces at stat.math.ethz.ch wrote on 27/02/2007 16:52:54:> Hi, > > I have been dabbling with str() to extract values from outputs such as > lmer etc and have found it very helpful sometimes. > > but only seem to manage to extract the values when the output is one > simple table, any more complicated and I'm stumped :-( > > take this example of the extracted coeficients from a lmer analysis... > > using str(coef(lmer(resp3~b$age+b$size+b$pcfat+(1|sex), data=b))) yields > > Formal class 'lmer.coef' [package "Matrix"] with 3 slots > ..@ .Data :List of 1 > .. ..$ :`data.frame': 2 obs. of 4 variables: > .. .. ..$ (Intercept): num [1:2] 1.07 1.13 > .. .. ..$ b$age : num [1:2] 0.00702 0.00702 > .. .. ..$ b$size : num [1:2] 0.0343 0.0343 > .. .. ..$ b$pcfat : num [1:2] 0.0451 0.0451 > ..@ varFac: list() > ..@ stdErr: num(0) > > how do I "get inside" the first table to get the value 1.07 for instance? > > Any help much appreciated. > > > Simon Pickett > PhD student > Centre For Ecology and Conservation > Tremough Campus > University of Exeter in Cornwall > TR109EZ > Tel 01326371852 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Apparently Analagous Threads
- [SPAM] - RE: REML with random slopes and random intercepts giving strange results - Bayesian Filter detected spam
- REML with random slopes and random intercepts giving strange results
- general question about plotting multiple regression results
- graph dimensions default
- help with structuring random factors using lmer()