Skip to content
Prev 301462 / 398503 Next

Working with Numbers generated from Regression Output

Hi David,

Thanks for the reply.

With your first alternative, I am getting the beta values in different
cells in the excel file.

Is there a way to get all the information generated by the summary
function in different cells in a excel file, through the write function?

Also, can you please elaborate on your third option. I went into the data
tab in excel, and chose from text option, as I had pasted the console
output of regression in a text file. But by doing this I am getting all
the output in a single cell in excel.

Thanks for your time.

Thanks & Regards,

Krunal Nanavati
9769-919198


-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net]
Sent: 27 July 2012 14:41
To: Krunal Nanavati
Cc: Jeff Newmiller; Jean V Adams; r-help at r-project.org
Subject: Re: [R] Working with Numbers generated from Regression Output
On Jul 27, 2012, at 12:14 AM, Krunal Nanavati wrote:

            
(First off, we have no wat y=to know what result is. I'm guessing its an
lm-object.

If that's correct, then you could try:

   write.csv( coef(result), file="C:\\Users\\Krunal\\Desktop\
\Book1.csv")

It is designed to write dataframes, but a simple list or vector of
coefficients sould get written (after coercion).

I think you can also do this (in Windows)

   write.csv( coef(result), file="clipboard")  # and then paste into Excel

Excel doesn't really have a corresponding data structure to a named
vector, so you won't get the names if you go the second route.

And finally, Excel has a /Data/Text to Columns facility that is useful for
turning console output into columnar data. Choose the fixed format menu.