[R] Excel Regression Function

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Wed Nov 7 19:41:01 CET 2012


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Paul Bernal
> Sent: Wednesday, November 07, 2012 10:17 AM
> To: frauke; r-help at r-project.org
> Subject: [R] Excel Regression Function
> 
> Dear Frauke, good afternoon,
> 
> Could you tell me which excel function didnt work for regression
> analysis
> and what excel version where you using?
> 
> Best regards,
> 
> Paul
> El 07/11/2012 11:55, "frauke" <fhoss at andrew.cmu.edu> escribió:
> 
> > Hi David, hi Rui,
> >
> > thanks for your quick replies. I have replicated David's R results
> and
> > confirmed them with Minitab. Though I'm not sure what you are trying
> to
> > tell
> > me with the code you wrote, David. Do you mean, I should use a
> dataframe
> > rather than a matrix, or use the "data=" part of the lm() function?
> >
> > Rui seems to be right, too. Excel's regression function doesn't work;
> I
> > cannot replicate the Minitab and R results with it. According to the
> > Microsoft website this is probably because the x- and y-values
> overlap. I
> > am
> > truly astonished that such a major bug doesn't at least have a major
> red
> > flag to it.
> >
> > Thank you! Frauke
> >
> >

Part of the problem is that Frauke is apparently posting from Nabble and is not providing context.  In the original post, the problem was reconciling output from linest in Excel with output from lm in R.  The problem appears to have been incorrect preparation of data and/or misspecification of the call to lm in R, and a misspecification of the linest formula in Excel.

I read the presented data into R and had no problem with the lm function (David Winsemius reported the same results).  I also loaded the data into Excel and got the same results using linest function as I got in R.  So, absent a reproducible example of the problem, I can only conclude operator error on the part of the OP in both cases.


Dan

Daniel Nordlund
Olympia, WA 98504-5204




More information about the R-help mailing list