Ajay Narottam Shah <ajayshah <at> mayin.org> writes: > > Consider this situation: > > x1 <- runif(100); x2 <- runif(100); y <- 2 + 3*x1 - 4*x2 + rnorm(100) > > m1 <- summary(lm(y ~ x1)) > > m2 <- summary(lm(y ~ x2)) > > m3 <- summary(lm(y ~ x1 + x2)) > > Now you have estimated 3 different "competing" models, and suppose you > want to present the set of models in one table. xtable(m1) is cool, > but doing that thrice would give us 3 different tables. > > What I want is this one table: > > ----------------------------------------------------------- > M1 M2 M3 > ----------------------------------------------------------- > Intercept 0.0816 3.6292 2.2272 > (0.5533) (0.2316)*** (0.2385)*** ...... (my gmane newreader complains when I quote too much, and contrary to the general believe on this list, I think he is right).
There is no standard way of doing this, so the first formatting must be done manually. For a nice output, check the R2HTML packages and the latex() derivates in Frank Harrell's Hmisc package. Dieter ______________________________________________ R-help@stat.math.ethz.ch 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.