-2

I'm doing R programming.I have a time series data set with more than 10 independent variables and a dependant variable. I want to run 10 individual regressions for each of those independent variables.I 'm using "for" command to get each column of my data table and run a regression. I don't know how can I save summary regression table automatically when I'm running this program. Would you please let me know how can I save those tables automatically as excel sheet or JPEG by writing some codes.

Thanks Afsaneh

1
  • 1
    A reproducible example is always helpful. You could save the summary tables with something like: res <- list() ... res[i] <- summary(...).
    – andybega
    Oct 13, 2014 at 6:51

1 Answer 1

0

There is a paper about producing ANOVA tables by hand or from an excel worksheet (I haven't tested it). If using ANOVA table produced by anova is sufficient for you, then this might work.

require(gridExtra)
mdl <- lm(mpg ~ cyl, data = mtcars)
grid.table(round(anova(mdl), 2))

# or save the result
jpeg("anovatable.jpg")
grid.table(round(anova(mdl), 2))
dev.off()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.