Created
November 29, 2012 00:32
-
-
Save sckott/4165847 to your computer and use it in GitHub Desktop.
model to data.frame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
library(plyr) | |
m1 <- lm(Petal.Length ~ Petal.Width, data=iris) | |
m2 <- lm(Petal.Length ~ Petal.Width + Species, data=iris) | |
tt <- function(x) { | |
temp <- data.frame(rnorm(1), summary(x)[4], summary(x)[8]) | |
names(temp) <- c("model", "est", "se", "t", "p", "r2") | |
temp | |
} | |
out <- ldply(list(m1, m2), tt) | |
write.csv(out, "~/mydata.csv") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment