This post is written as a result of finding the following exchange on one of the R mailing lists:
Is-there-a-way-to-export-regression-output-to-an-excel-spreadsheet
[Make sure to check out the many great comments on the bottom of the post. That is where some better answers to this problem can be found.]
Question: Is there a way to export regression output to an excel spreadsheet?
Translation: I would like to be able to do a very simple thing that almost any statistical programming language can easily do, please suggest a basic command to do that.
Response1: ?lm ?coef ?write.csv ...
Translation: Read the manual and try this bit of incomplete code.
Questioner: I am very very new with R... Is there some simple code I could just paste?
Translation: Really? Isn't there anything you could suggest?
Response2: This is the help-you-learn-R mailing list, not the do-my-work-for-me mailing list...
Translation: Go F%$# yourself, freeloader. We only answer interesting questions.
Me:
I just wanted to say that it is just this type of response that gives R-users a bad reputation. I am an active R user and very happy to contribute to R in whatever way is possible but when I see posts like this, it makes me want to switch to a language in which the users are NICE people. Okay, I know, I know. A few bad apples should not spoil the basket, but sometimes things just taste rotten.
First thing, the reason I even stumbled across this post was because I had the same very similar question. Looking at the hits on the bottom of the page I can see that there are over 400 people who have viewed this discussion I am guessing most of them because they were looking for a specific solution rather than being interested in seeing how quickly experienced R users could could offend new users (for which there are numerous other examples).
In all likelihood, a lot of other new R users have come across this same post and been equally confounded but this rude and ridiculous response.
The original user who asked this question asked a very simple question for which any statistical language should have a very simple canned response. Something along the lines:
lmOut(mylm, file="results", filetype="csv")
Yet the response that was instead produced was one which was overly complex, patronizing, and ultimately needlessly insulting.
I have written a little program to help format regression summary statistics into spreadsheet formats easily read by excel. Sorry if this is redundant. I am sure hundreds of people have programmed similar solutions. But I think it might be useful to many users who are not very familiar with how R constructs results.
Find the code on this gist:
https://gist.github.com/EconometricsBySimulation/6274532
Output looks something like this:
Looking over the original exchange it does not look like this code would even work for a logit for which it was originally needed. However, I will post it on github and perhaps others will find the concept useful enough to make revisions (unlikely). I might take another go at making it more general in the future though in all likelihood some user will send me an angry message saying "this has already been done by ...".
Is-there-a-way-to-export-regression-output-to-an-excel-spreadsheet
[Make sure to check out the many great comments on the bottom of the post. That is where some better answers to this problem can be found.]
Question: Is there a way to export regression output to an excel spreadsheet?
Translation: I would like to be able to do a very simple thing that almost any statistical programming language can easily do, please suggest a basic command to do that.
Response1: ?lm ?coef ?write.csv ...Translation: Read the manual and try this bit of incomplete code.
Questioner: I am very very new with R... Is there some simple code I could just paste?
Translation: Really? Isn't there anything you could suggest?
Response2: This is the help-you-learn-R mailing list, not the do-my-work-for-me mailing list...
Translation: Go F%$# yourself, freeloader. We only answer interesting questions.
Me:
I just wanted to say that it is just this type of response that gives R-users a bad reputation. I am an active R user and very happy to contribute to R in whatever way is possible but when I see posts like this, it makes me want to switch to a language in which the users are NICE people. Okay, I know, I know. A few bad apples should not spoil the basket, but sometimes things just taste rotten.
First thing, the reason I even stumbled across this post was because I had the same very similar question. Looking at the hits on the bottom of the page I can see that there are over 400 people who have viewed this discussion I am guessing most of them because they were looking for a specific solution rather than being interested in seeing how quickly experienced R users could could offend new users (for which there are numerous other examples).
In all likelihood, a lot of other new R users have come across this same post and been equally confounded but this rude and ridiculous response.
The original user who asked this question asked a very simple question for which any statistical language should have a very simple canned response. Something along the lines:
lmOut(mylm, file="results", filetype="csv")
Yet the response that was instead produced was one which was overly complex, patronizing, and ultimately needlessly insulting.
I have written a little program to help format regression summary statistics into spreadsheet formats easily read by excel. Sorry if this is redundant. I am sure hundreds of people have programmed similar solutions. But I think it might be useful to many users who are not very familiar with how R constructs results.
Find the code on this gist:
https://gist.github.com/EconometricsBySimulation/6274532
Output looks something like this:
Looking over the original exchange it does not look like this code would even work for a logit for which it was originally needed. However, I will post it on github and perhaps others will find the concept useful enough to make revisions (unlikely). I might take another go at making it more general in the future though in all likelihood some user will send me an angry message saying "this has already been done by ...".
