Re: [R] lm fails on some large input

2019-04-18 Thread Dingyuan Wang
The final goal is to make two lines and find the intersection point. I don't want to argue more about the reason. The tol suggestion is reasonable, and I'll take that. 2019/4/19 4:12, Jeff Newmiller: The fact that you think x~y is interchangeable with y~x suggests to me that you will have a

Re: [R] lm fails on some large input

2019-04-18 Thread Fox, John
gt; Wang > Sent: Thursday, April 18, 2019 12:36 PM > To: Michael Dewey ; r-help@r-project.org > Subject: Re: [R] lm fails on some large input > > I just want to make a line out of timestamps vs some coordinates, so y~x or > x~y doesn't matter. > > Yes, I know the answer. Wh

Re: [R] lm fails on some large input

2019-04-18 Thread Jeff Newmiller
The fact that you think x~y is interchangeable with y~x suggests to me that you will have a difficult time convincing R Core that this is a bug. I recommend that you take at leastan upper division college course in linear regression first. On April 18, 2019 9:35:55 AM PDT, Dingyuan Wang

Re: [R] lm fails on some large input

2019-04-18 Thread Dingyuan Wang
I just want to make a line out of timestamps vs some coordinates, so y~x or x~y doesn't matter. Yes, I know the answer. When trying R, I'm surprised that R can't solve that either. I first noticed that PostgreSQL can't solve it, and found that they fixed that in pg 12.

Re: [R] lm fails on some large input

2019-04-18 Thread Jeff Newmiller
I make a general rule not to stick time values into numerical analysis algorithms without first subtracting a reasonable epoch (to obtain difftime) and then using as.numeric.POSIXt with the units argument set explicitly so the analysis uses numeric values that I can interpret. While the

Re: [R] lm fails on some large input

2019-04-18 Thread Fox, John
Dear Peter, > -Original Message- > From: peter dalgaard [mailto:pda...@gmail.com] > Sent: Thursday, April 18, 2019 12:23 PM > To: Fox, John > Cc: Michael Dewey ; Dingyuan Wang > ; r-help@r-project.org > Subject: Re: [R] lm fails on some large input > > Um,

Re: [R] lm fails on some large input

2019-04-18 Thread Berry, Charles
> On Apr 18, 2019, at 8:24 AM, Michael Dewey wrote: > > Perhaps subtract 1506705766 from y? Good advice. Some further notes follow. One can specify `tol` to have a smaller than default value e.g. m2 <- lm(x ~ y, tol=1e-12) which is accurate: plot(y,x) abline(coef=coef(m2)) Users

Re: [R] lm fails on some large input

2019-04-18 Thread William Dunlap via R-help
This sort of data arises quite easily if you deal with time/dates around now. E.g., > d <- data.frame( + when = seq(as.POSIXct("2017-09-29 18:22:01"), by="secs", len=10), + measurement = log2(1:10)) > coef(lm(data=d, measurement ~ when)) (Intercept) when

Re: [R] lm fails on some large input

2019-04-18 Thread peter dalgaard
d Dingyuan Wang, > >> -Original Message- >> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael >> Dewey >> Sent: Thursday, April 18, 2019 11:25 AM >> To: Dingyuan Wang ; r-help@r-project.org >> Subject: Re: [R] lm fails on some large inp

Re: [R] lm fails on some large input

2019-04-18 Thread Fox, John
Dear Michael and Dingyuan Wang, > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael > Dewey > Sent: Thursday, April 18, 2019 11:25 AM > To: Dingyuan Wang ; r-help@r-project.org > Subject: Re: [R] lm fails on some large input >

Re: [R] lm fails on some large input

2019-04-18 Thread Michael Dewey
Perhaps subtract 1506705766 from y? Saying some other software does it well implies you know what the _correct_ answer is here but I would question what that means with this sort of data-set. On 17/04/2019 07:26, Dingyuan Wang wrote: Hi, This input doesn't have any interesting properties

[R] lm fails on some large input

2019-04-18 Thread Dingyuan Wang
Hi, This input doesn't have any interesting properties except y is unix time. Spreadsheets can do this well. Is this a bug that lm can't do x ~ y? R version 3.5.2 (2018-12-20) -- "Eggshell Igloo" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu