tsreg

Does a time series regression. Different from lm. lm is a general regression function, so it doesn’t do what you want for time series regression. tsreg returns the following in its output:

Arguments

tsreg <- function(y.raw, x.raw, start=NULL, end=NULL, intercept=TRUE)

Examples

tsreg(y, x)
tsreg(y, x, start=c(2014,1))
tsreg(y, x, end=c(2019,12))
tsreg(y, x, start=c(2000,6), end=c(2018,4))
fit <- tsreg(y, x, intercept=FALSE)

# Can treat the output like lm - because it is
AIC(fit)
coefficients(fit)
summary(fit)

# ts properties
fit$resids
fit$fitted
fit$start
fit$end