add_car1 | R Documentation |
Add the CAR(1) autocorrelation structure.
add_car1(x, response, gr_vars = c(".index", "series"))
x |
A dataframe. |
response |
The column of |
gr_vars |
Grouping variables withing which to calculate lagged residuals. |
The input dataframe with the fitted values transformed to have the CAR(1) autocorrelation structure.
data_ar <- read.csv(paste0(system.file("extdata", package = "bgamcar1"), "/data_ar.csv"))
data_ar$`ar[1]` <- .7
data_ar$.epred <- 0
add_car1(data_ar, "y", gr_vars = "series")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.