Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

autocorr

Autocorrelation for single-case data


Description

The autocorr function calculates autocorrelations within each phase and across all phases.

Usage

autocorr(data, dvar, pvar, mvar, lag.max = 3, ...)

autocorrSC(...)

Arguments

data

A single-case data frame. See scdf to learn about this format.

dvar

Character string with the name of the dependent variable. Defaults to the attributes in the scdf file.

pvar

Character string with the name of the phase variable. Defaults to the attributes in the scdf file.

mvar

Character string with the name of the measurement time variable. Defaults to the attributes in the scdf file.

lag.max

The lag up to which autocorrelations will be computed. Default is lag.max = 3.

...

Further arguments passed to the acf function

Value

A data frame containing separate autocorrelations for each phase and for all phases (for each single-case). If lag.max exceeds the length of a phase minus one, NA is returned for this cell.

Author(s)

Juergen Wilbert

See Also

Examples

## Compute autocorrelations for a list of four single-cases up to lag 2.
autocorr(Huber2014, lag.max = 2)

scan

Single-Case Data Analyses for Single and Multiple Baseline Designs

v0.51
GPL
Authors
Juergen Wilbert [aut, cre], Timo Lueke [aut]
Initial release
2021-2-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.