[R] lm and time series: simple question

mwh@indiana.edu mwh at indiana.edu
Thu Jun 16 23:50:46 CEST 2005



Hello:

This question is partly about R and partly out of my ignorance about time series.

I want to regress one time series on another, taking into account the
autocorrelation (in an AR1 model) within each series.  I am interested in how
the standard error changes when the acf is taken into account.

I've made both of my datasets into ts objects and used the basic lm function
(with na.action=NULL) to no effect (i.e. the resulting standard error is the
same as if they were not times series).  I've also looked at binding the two
series together with ts.union or ts.intersect, but then I am left with a single
object, and don't understand how to regress one of the components of this onto
the other.


Any help on this subject would be appreciated.


cheers,
Matt




More information about the R-help mailing list