Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-16 Thread Gene Leynes
until last week, what as.numeric(POSIXct) > would give). > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Gene Ley

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-16 Thread William Dunlap
.@r-project.org] On > Behalf > Of Gene Leynes > Sent: Monday, April 16, 2012 12:42 AM > To: peter dalgaard > Cc: r-help > Subject: Re: [R] Seemingly simple "lm" giving unexpected results > > Peter, > > This is exactly the answer I was wanted. > > 1) I was

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-16 Thread Gene Leynes
Peter, This is exactly the answer I was wanted. 1) I was a little fuzzy on how the qr decomposition was creating the "error" 2) I wanted to know if it was possible to just change a setting to get around the "error". Changing the tol in lm makes a lot more sense to me than changing the global eps

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-14 Thread Berend Hasselman
On 14-04-2012, at 21:45, peter dalgaard wrote: > > On Apr 14, 2012, at 14:40 , Berend Hasselman wrote: > >> >> On 13-04-2012, at 22:20, Gene Leynes wrote: >> >>> I can't figure out why this is returning an NA for the slope in one case, >>> but not in the other. >>> >>> I can tell that R thin

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-14 Thread peter dalgaard
On Apr 14, 2012, at 14:40 , Berend Hasselman wrote: > > On 13-04-2012, at 22:20, Gene Leynes wrote: > >> I can't figure out why this is returning an NA for the slope in one case, >> but not in the other. >> >> I can tell that R thinks the first case is singular, but why isn't the >> second? >>

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-14 Thread Gene Leynes
Thank you Berend and Mark, It seems pretty clear, the problem is with the numbers and not with R. Intuitively, I didn't think that regressing on Y on X would give different results than regressing Y on X - C (where C is a constant). So, I thought that R was doing something strange with rounding.

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-14 Thread Berend Hasselman
On 13-04-2012, at 22:20, Gene Leynes wrote: > I can't figure out why this is returning an NA for the slope in one case, > but not in the other. > > I can tell that R thinks the first case is singular, but why isn't the > second? > > ## Define X and Y > ## There are two versions of x > ## 1)

[R] Seemingly simple "lm" giving unexpected results

2012-04-13 Thread Gene Leynes
I can't figure out why this is returning an NA for the slope in one case, but not in the other. I can tell that R thinks the first case is singular, but why isn't the second? ## Define X and Y ## There are two versions of x ## 1) "as is" ## 2) shifted to start at 0 y = c(58, 57, 57, 279,