As a start, run matchit() for a test dataset and look at: names(m.out) and names(summary(m.out)) You can save those named components in the usual ways.
Sarah On Sun, Jun 26, 2011 at 10:06 AM, Ana Kolar <annako...@yahoo.com> wrote: > Hi there, > > Does anyone know how to extract data from a function that prints out two or > more summaries? In the function below (the whole code is provided) we get 5 > different tables of data. I would like to split each of these tables in a > separate file (while the function itself shouldn't be changed), so that > further analysis on each data set could be carried out. Your help is deeply > appreciated. Have a good day. Ana > > > Here is the code: > > library(MatchIt) > > f <- treat ~ age + I(age^2) + educ + I(educ^2) + black + hispan + > married + nodegree + re74 + I(re74^2) + re75 + I(re75^2) > > d <- lalonde > > m <- "nearest" > > matching <- function(formula,data,method){ > library(MatchIt) > m.out <- matchit(formula=f, data=d, method=m) > print(m.out) > print(summary(m.out)) > } > > matching(f,d,m) > > [[alternative HTML version deleted]] > > -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ 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.