ABABmodel: Bayesian Estimation of Effect Sizes in ABAB Reversal Designs

Description Usage Arguments Value References Examples

View source: R/ABABmodel.R

Description

This function computes a lag-1 autoregression time series analysis with Bayesian estimates for ABAB reversal designs. It can be used with data from an ABAB reversal design to examine the effect of the introduction of a treatment B after a baseline A, followed up by a retreat and then a reintroduction of such treatment.

Usage

1
2
3
ABABmodel(y, P, s, model = 'level', plots = TRUE, diagnostics = FALSE,
            adaptSteps = 10000, burnInSteps = 100000, nChains = 3,
              numSavedSteps = 200000, thinSteps = 10)

Arguments

y

outcome variable

P

phase identifier

s

session identifier

model

the model to be fitted. If set to "level" (the default), an intercepts only model is calculated. If set to "trend", an intercepts and slopes model is calculated.

plots

whether graphs are to be plotted. Defaults to TRUE.

diagnostics

whether diagnostic statistics are to be calculated. Defaults to FALSE. The diagnostics option retrieves the Gelman-Rubin statistic (which measures the ratio of the between-within variability within the chains); the ESS or effective sample size (which measures the independent information within the sampled chains given their length and autocorrelation); and the MCSE or Monte Carlo Standard Error (which measures the estimated standard deviation of the sample mean in the chains).

adaptSteps

number of steps to adapt the chain

burnInSteps

number of steps to burn in

nChains

number of chains to be computed

numSavedSteps

total number of steps to be computed

thinSteps

save every nth number of steps in the chain

Value

beta

model regression coefficients estimates

phase

phase regression coefficients estimates

delta

phase change effect size estimates

References

Kruschke, J. (2010). Doing Bayesian Data Analysis: A Tutorial Introduction with R. Boston, MA.: Academic Press.

Swaminathan, H., Rogers, H. J., & Horner, R. H. (2014). An effect size measure and Bayesian analysis of single-case designs. Journal of School Psychology, 52(2), 213-230. doi:10.1016/j.jsp.2013.12.002

Examples

1
2
3
4
5
library(SCEDbayes)
dat = subset(LAMBERT, LAMBERT$STUDENT==1)
y = dat$DATA.POINT; P = dat$PHASE; s = dat$SESSION;
model1 = ABABmodel(y, P, s, model = 'level') # Intercepts only model
model2 = ABABmodel(y, P, s, model = 'trend') # Intercepts and slopes model

laandrad/SCEDbayes documentation built on May 20, 2019, 7:31 p.m.