## In this example only 2 iterations are needed to achieve (convergence of rho at the 5th digit)
sales.est <- ols(sales ~ price, data = data.filter)
cochorc(sales.est)
## For a higher precision we need 6 iterations
cochorc(sales.est, tol = 0.0000000000001)
## Direct usage of a model formula
X <- cochorc(sick ~ jobless, data = data.sick[1:14,], details = TRUE)
## See iterated regression results
X$all.regs
## Print full details
X
## Suppress details
print(X, details = FALSE)
## Plot rho over iterations to see convergence
plot(X)
## Example with interaction
dummy <- as.numeric(data.sick$year >= 2005)
kstand.str.est <- ols(sick ~ dummy + jobless + dummy*jobless, data = data.sick)
cochorc(kstand.str.est)
Run the code above in your browser using DataLab