On Tue, Jun 16, 2009 at 3:29 AM, Cecilia Carmo<cecilia.ca...@ua.pt> wrote:
> Hi r-helpers!
>
> I need to save the output of summary() function that I’ve runned like this:
> z<- lmList(y~x1+x2| x3, na.action=na.omit,data1,subset=year==1999)
> w<-summary(z)
> The output (w) is something like this:
> Call:
>  Model: y ~ x1 + x2 | x3
>   Data: data1


Does this come close?  I'm just using the lmList example from lme4

### example(lmList) spawns an object "fm1" that I demonstrate with:


library(lme4)

example(lmList)


varnames <- names(fm1[[1]]$coefficients)



mylist <- lmlist(fm1, summary)

varnames <- names(fm1[[1]]$coefficients)


myCoefficients <- function(x, name) { x[name,] }

theintercepts <- t( sapply(mylist, myCoefficients, varnames[1]))

theSecondVar <- t( sapply(mylist, myCoefficients, varnames[2]))


I know other r-help readers will know a better way to cycle through
the variables rather than running once for each element of varnames...


-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

______________________________________________
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.

Reply via email to