-3

Assume we have regression lines for these time series, I want to know which of them more likely gets to a certain value first (e.g., 4), or the probability distribution of time to reach a value.

date         series1      series2
01-04          2            1.8
02-01          2.075        2.3
03-01          2.15         2.1
04-08          2.225        2.2
04-09          2.3          2.4

lr1=lm(series1~ date)
lr2=lm(series2~ date)
khodayar J
  • 914
  • 8
  • 16
  • 1
    Please consider reading up on [ask] and how to produce a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Heroka Mar 21 '16 at 20:35
  • @Heroka , how can i get rid of this question ? If I clearly knew what I was asking I would never ask the question in first place. with your irresponsible unclear tags I've been banned from asking more questions – khodayar J Jul 12 '17 at 14:08
  • 1
    It was not this particular question that made you ineligible for asking additional questions. It was your entire *history* of questions. That message already carried with it a link to the [Help Center](https://stackoverflow.com/help/question-bans); obviously you didn't read it. Perhaps you will read [this](https://meta.stackoverflow.com/q/255583). That will explain how you could go about resolving the problem. Deleting your old questions won't help; deleted questions are taken into account also. You have a *lot* of deleted questions---not a good sign. – Cody Gray - on strike Aug 10 '17 at 13:57
  • You have 11 questions total. 6 of them are deleted; 5 of them are still visible. As I said, deleted questions are still taken into account by the algorithm that determines eligibility for asking questions. These are your deleted questions, in case you've lost the links and want to revisit them: https://stackoverflow.com/q/32279745, https://stackoverflow.com/q/32981080, https://stackoverflow.com/q/33758907, https://stackoverflow.com/q/33856745, https://stackoverflow.com/q/35636274, https://stackoverflow.com/q/42162462 – Cody Gray - on strike Aug 10 '17 at 14:08
  • Thank you @CodyGray, so actually there is no feasible way to get out of this answer ban, thanks to professionals ! who easily give negative points to others – khodayar J Aug 10 '17 at 14:40

1 Answers1

1

Since there is no explanation in the question of what the date column means we will use 1:nrows for the date. The result shown is the time at which each series reaches 4.

tt <- 1:nrow(DF)
co <- coef(lm(cbind(series1, series2) ~ tt, DF))

# solving 4 = a + b * t for t gives:
(4 - co[1,]) / co[2,]
## series1 series2 
##  27.667  19.727 

Note: We used this for the input, DF:

Lines <- "date         series1      series2
01-04          2            1.8
02-01          2.075        2.3
03-01          2.15         2.1
04-08          2.225        2.2
04-09          2.3          2.4"

DF <- read.table(text = Lines, header = TRUE)
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341