Hi,
I posted a question last week on how to export results of summary output of regression. Thanks to Harry Southworth, Chris Barker, Terry Therneau for their responses! Below are the question and responses. In addition, I realized that the scan() function may be useful as well.
Original question
Dear S-users,
I wonder if there is any way I can export the output generated (or place them in an easily readable form) when performing a regression or regression diagnostics with S functions like summary(), heteroTest, normalTest etc together into say a pdf file/reports since this will make for easier reading as a whole.
It will be even better if output from multiple regressions can be exported out into a single document using a function like pdf() as I may need to do many regressions and see the output as a whole.
Many thanks for your help!
From Harry Southworth
?createXMLFile
?xml2html
?xml2pdf
The XSL stylesheets that come with S-PLUS are a bit ropey, so you might need to write your own. You'd also have to do a bit more work to embed graphs.
hth
Harry
From Chris Barker
Chris Barker, Ph.D. Consulting Statistician
From Terry Therneau
You question almost exactly describes the functionality of the Sweave and odfweave packages. Look them up on google.
Terry Therneau
Alternate method
# Write the output to the file given sink("C:\\testLM.txt")
# Call regressions test.lm.1 <- lm(Fuel~., data=""> test.lm.1 summary(test.lm.1)
test.lm.2 <- lm(Fuel~Mileage+Type, data=""> test.lm.2 summary(test.lm.2)
# Return the output back to the program sink()
Best Regards,
Weiyang
|