[R] predict.lm() does not take ts objects in formula

Gabor Grothendieck ggrothendieck at gmail.com
Mon Feb 24 04:16:01 CET 2014

On Sun, Feb 23, 2014 at 9:06 PM, C W <tmrsg11 at gmail.com> wrote:
> Is there a way to rbind this?  Do I have to use use a package like 'zoo' and
> merge()?
> p <- predict(model, data.frame(t = 1, q = factor(1, 1:4))
> rbind(tsdat, p)

If you want to append this to the end of the series then try this:

ts(c(tsdat, p), start = start(tsdat), frequency = frequency(tsdat))

Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

More information about the R-help mailing list