batch_calc_BCSMD.RdCalculates standardized mean difference effect sizes for a data set including one or multiple single-case design studies using the same design (treatment reversal, multiple baseline/probe across participants, replicated multiple baseline across behaviors, or clustered multiple baseline across participants).
batch_calc_BCSMD(
data,
design,
grouping,
case,
phase,
session,
outcome,
cluster = NULL,
series = NULL,
center = 0,
round_session = TRUE,
treatment_name = NULL,
FE_base = 0,
RE_base = 0,
RE_base_2 = NULL,
FE_trt = 0,
RE_trt = NULL,
RE_trt_2 = NULL,
corStruct = "AR1",
varStruct = "hom",
Bayesian = FALSE,
prior = NULL,
chains = 4,
iter = 2000,
warmup = iter/2,
thin = 10,
cores = 1,
seed = NA,
A = NULL,
B = NULL,
D = NULL,
cover = 95,
bound = 35,
symmetric = TRUE,
summary = TRUE,
...
)A data frame containing SCD data for which design-comparable effect sizes will be calculated.
Character string to specify whether data comes from a treatment
reversal ("TR"), multiple baseline across participants
("MBP"), replicated multiple baseline across behaviors
("RMBB"), or clustered multiple baseline across participants
("CMB").
A variable name or list of (unquoted) variable names that uniquely identify each study.
A variable name (unquoted) that identifies unique cases within
each grouping variable.
A variable name (unquoted) that identifies unique treatment phases.
A variable name (unquoted) that contains the measurement times for each data series.
A variable name (unquoted) that contains the outcome measurements for each data series.
(Optional) variable name (unquoted) that identifies the unique
clusters of cases for CMB designs.
(Optional) variable name (unquoted) that identifies the unique
data series for RMBB designs.
Numeric value for the centering value for session. Default is 0.
Logical indicating whether to round session to the nearest integer. Defaults to TRUE.
(Optional) character string corresponding to the name of the treatment phase.
Vector of integers specifying which fixed effect terms to
include in the baseline phase. Setting FE_base = 0 includes only a
level. Setting FE_base = c(0,1) includes a level and a linear time
trend.
Vector of integers specifying which random effect terms to
include in the baseline phase. Setting RE_base = 0 includes only
levels (i.e., random intercepts). Setting RE_base = c(0,1) includes
random levels and random linear trends.
Vector of integers specifying which random effect terms to
include in the baseline phase for the cluster level in clustered multiple
baseline design across participants or for the case level in replicated
multiple baseline across behaviors. Setting RE_base_2 = 0 includes
only levels (i.e., random intercepts). Setting RE_base_2 = c(0,1)
includes random levels and random linear trends.
Vector of integers specifying which fixed effect terms to
include in the treatment phase. Setting FE_trt = 0 includes only a
change in level. Setting FE_trt = c(0,1) includes a change in level
and a treatment-by-linear time trend.
Vector of integers specifying which random effect terms to
include in the treatment phase. Setting RE_trt = 0 includes only
random changes in level. Setting RE_trt = c(0,1) includes random
changes in level and random treatment-by-linear time trends.
Vector of integers specifying which random effect terms to
include in the treatment phase for the cluster level in clustered multiple
baseline design across participants or for the case level in replicated
multiple baseline across behaviors. Setting RE_trt_2 = 0 includes
only random changes in level. Setting RE_trt_2 = c(0,1) includes
random changes in level and random treatment-by-linear time trends.
(Optional) character string indicating the correlation
structure of session-level errors. Options are "AR1" (default),
"MA1", or "IID".
(Optional) character string indicating the
heteroscedasticity structure of session-level errors. Options are
"hom" (default) or "het", which allows for the session-level
error variances to differ by phase.
Logical indicating whether to apply Bayesian estimation
methods. If FALSE (default), apply restricted maximum likelihood
estimation. If TRUE, apply Bayesian estimation methods (i.e., Markov
Chain Monte Carlo) to the parameters of the specified hierarchical linear
model.
(Optional) One or more brmsprior objects created by
"set_prior" in the "brms" R package. Default is prior =
NULL when flat priors will be applied for Bayesian estimation.
Ignored if Bayesian = FALSE.
Number of Markov chains to use for Bayesian estimation. Default
is chains = 4. Ignored if Bayesian = FALSE.
Number of iterations per chain to use for Bayesian estimation.
Default is iter = 2000. Ignored if Bayesian = FALSE.
Number of burn-in iterations to use for Bayesian estimation.
Default is iter/2. Ignored if Bayesian = FALSE.
Thinning rate to use for Bayesian estimation. Default is
thin = 10. Ignored if Bayesian = FALSE.
Number of cores to use for Bayesian estimation. Default is
cores = 1. Ignored if Bayesian = FALSE.
Random number generation seed to use for Bayesian estimation.
Default is seed = NA, which will cause the seed to be set randomly.
Ignored if Bayesian = FALSE.
The time point immediately before the start of treatment in the hypothetical between-group design.
The time point at which outcomes are measured in the hypothetical between-group design.
Numerical indicating the treatment duration across cases. Note that
B = A + D and it is not allowed to specify both B and
D.
Confidence level.
Numerical tolerance for non-centrality parameter in
qt.
If TRUE (the default), use a symmetric confidence
interval. If FALSE, use a non-central t approximation to obtain an
asymmetric confidence interval.
Logical indicating whether to return a data frame with effect
size estimates and other information. If TRUE (default), return a
data.frame containing the effect size estimate, standard error,
confidence interval (or credible interval if Bayesian == TRUE), and
other information. If FALSE, return a list with effect size
estimate, degrees of freedom, and other information.
further arguments passed to calc_BCSMD.
A data frame containing the design-comparable effect size estimate,
standard error, confidence interval, and other information, for each unique
category of grouping variable(s).
data(Thiemann2001)
data(Thiemann2004)
datThiemann <- rbind(Thiemann2001, Thiemann2004)
# Change-in-levels model with a fixed treatment effect
batch_calc_BCSMD(data = datThiemann,
grouping = Study_ID,
design = "RMBB",
case = case, series = series, phase = treatment,
session = time, outcome = outcome,
FE_base = 0, RE_base = 0,
RE_base_2 = 0, FE_trt = 0)
# Models with linear time trends in baseline and treatment phase,
# random baseline slope at series level, fixed treatment effects
batch_calc_BCSMD(data = datThiemann,
grouping = Study_ID,
design = "RMBB",
case = case, series = series, phase = treatment,
session = time, outcome = outcome,
FE_base = c(0,1), RE_base = c(0,1),
RE_base_2 = 0, FE_trt = c(0,1))