[R-SIG-Finance] Error in lm prediction
ed.herranz at gmail.com
Mon Jul 24 20:10:49 CEST 2017
My guess is that you can't use lm() directly on xts objects. See this:
On Sun, Jul 16, 2017 at 4:31 PM, amol gupta <amolgupta87 at gmail.com> wrote:
> I am most likely committing an error in trying to predict using linear
> regression lm model. please help me figure out what am I doing wrong. I am
> trying to regress a index and its constituents. Here is the code
> #split ts inttwo parts
> m1<-lm( y1~x1)
> ##out of sample
> x,y are xts. X contains multiple time series. The y_ hat turns out to be of
> 300 samples only, whereas x2 contains 1400 samples.
> Please help me figure out how to predict using model that I have found
> using regression.
> [[alternative HTML version deleted]]
> R-SIG-Finance at r-project.org mailing list
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
[[alternative HTML version deleted]]
More information about the R-SIG-Finance