Re: [R] data extrapolation function

2011-01-29 Thread Dennis Murphy
Hi: This 'works': > di <- read.csv(textConnection(" + 10,2000 + 12,2001 + 13,2002 + 15,2003 + 17,2004"), header = FALSE) > names(di) <- c('y', 'year') > m <- lm(y ~ year, data = di) > diextra <- data.frame(year = c(1990, 1991, 1993)) > predict(m, new = diextra) 123 -7.0 -5.3 -1.9 You

[R] data extrapolation function

2011-01-29 Thread e-letter
Readers, Data was imported using the read csv command: dataimport<-read.csv("/path/to/dataimport.csv") 10,2000 12,2001 13,2002 15,2003 17,2004 Using the help contents for 'predict.lm' (i.e. ?predict.lm) a new data frame was created dataimportextra<-data.frame(x=seq(1990,2010,1)) predict(lm(dat