Skip to content
Prev 246241 / 398506 Next

optimize

Hi Muhammad,

On Mon, Jan 3, 2011 at 6:52 AM, Muhammad Rahiz
<muhammad.rahiz at ouce.ox.ac.uk> wrote:
What is your code supposed to do?  This is one way to get three
intersecting curves, but I am not sure it is doing what you were
hoping to do with the sample code you sent.

ts <- seq(200, 209, 1)
dd <- c(NA,NA,NA,NA,1.87,1.83,1.86,NA,1.95,1.96)
xy <- lm(dd ~ ts)

plot(x = ts, y = dd, ylim = c(1.5,2))
abline(xy, col = "blue", lty = 2)
abline(v = 203, h = predict(xy, data.frame(ts = 203)),
  col = "blue", lty = 2)

Best regards,

Josh