I am using dlnm
and lm
to fit a linear model of a number of time series. I would like to visually compare the fitted values with the actual values, and so I want to export both in one csv file. However, it appears that I cannot use ts.intersect
to bind them because $fitted.values
of the model is not a time series. The documentation of lm
suggests that $fitted.values
will be a time series if na.action = NULL
is passed to the lm
. However, this is only possible if the values used as input are defined everywhere, which is not the case if crossbasis
is applied with non-trivial lag.
Is there a convenient way to get the actual and fitted time series side by side?