Here is my current process: x.sub<- subset(Model.Update, Row <200& Row >0) # INITIAL SAMPLE x.sub1<-subset(Model.Update, Row <206& Row >200) # Subset into lots of 5 until current period - 5 period ... update frequency x.subn<-subset(Model.Update, Row <XXX & Row >XXX)
# Run regressions A1<-lm(y ~ x + z, data=x.sub) # Will forecast 200 to 205 A2<-lm(y ~ x + z, data=x.sub1) # will forecast 206 to 210 ... An<-lm(y ~ x + z, data=x.subn) name<-predict(A1,x.sub1) # Make predictions for subset ... namen<-predict(An,x.subn) Then export to excel. write.csv(name,file="1.csv") write.csv(namen,file="n.csv") Seems like there must be an easier way then creating hundreds of subsets. I build all my lines in excel, concatenate, then copy and paste into R to save time. Cheers Steve -- View this message in context: http://r.789695.n4.nabble.com/Computing-predictive-values-tp4687832p4687844.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.