calc_acf: Calculate residual autocorrelation

View source: R/calc_acf.R

calc_acfR Documentation

Calculate residual autocorrelation

Description

Calculate residual autocorrelation

Usage

calc_acf(x, ..., gr_vars = NULL, cen_var = NULL)

Arguments

x

A data.frame

...

Arguments passed to a data.table chain for subsetting the data.frame after calculating the lagged residual/censoring vectors.

gr_vars

Calculate lagged residual/censoring vector within these groups.

cen_var

Name of the censoring variable to be (optionally) lagged.

Value

A tibble with a Spearman rank correlation coefficient for each residual draw.

Examples


res <- data.frame(
  .draw = 1,
  .residual = c(1:9, -1e2),
  location = "a"
)
calc_acf(res, gr_vars = c(".draw", "location"))


bentrueman/bgamcar1 documentation built on July 6, 2024, 11:16 p.m.