batch_calc_ES: Calculate effect sizes from a dataset for multiple series

View source: R/calculate-effect-sizes.R

batch_calc_ESR Documentation

Calculate effect sizes from a dataset for multiple series

Description

Calculates one or more effect size estimates, along with associated standard errors and confidence intervals, if available, for a single-case data series.

Usage

batch_calc_ES(
  dat,
  grouping,
  condition,
  outcome,
  aggregate = NULL,
  weighting = "equal",
  session_number = NULL,
  baseline_phase = NULL,
  intervention_phase = NULL,
  ES = c("LRRd", "LRRi", "SMD", "Tau"),
  improvement = "increase",
  scale = "other",
  intervals = NA,
  observation_length = NA,
  goal = NULL,
  confidence = 0.95,
  format = "long",
  warn = TRUE,
  ...
)

Arguments

dat

data frame containing SCD series for which effect sizes will be calculated.

grouping

A variable name or list of (unquoted) variable names that uniquely identify each data series.

condition

A variable name that identifies the treatment condition for each observation in the series.

outcome

A variable name for the outcome data. Default is

aggregate

A variable name of list of (unquoted) variable names that identify additional grouping variables. Effect sizes will be calculated separately for each unique value of these variables, after which the effect size estimates will be averaged across values of these variables (but not across the values of the grouping variables).

weighting

character string specifying the weighting scheme for use when variables are specified in aggregate. Available is "1/V", "equal" (the default), "Equal", "nA", "n_A", "nB", "n_B", "nAnB", "nA*nB", "nA*nB", "n_A*n_B", "n_A * n_B", "1/nA+1/nB", "1/nA + 1/nB", "1/n_A+1/n_B", or "1/n_A + 1/n_B". Note that "1/V" can only be used for effect sizes with known standard errors.

session_number

A variable name used to order the data within each series.

baseline_phase

character string specifying which value of condition corresponds to the baseline phase. If NULL (the default), the first observed value of condition within the series will be used.

intervention_phase

character string specifying which value of condition corresponds to the intervention phase. If NULL (the default), the second unique value of condition within the series will be used.

ES

character string or character vector specifying which effect size index or indices to calculate. Available effect sizes are "LRRd", "LRRi", "LRM", "LOR", "SMD", "NAP", "IRD", "PND", "PEM", "PAND", "PoGO", "Tau", "Tau-U", and "Tau-BC". Set to "all" for all available effect sizes. Set to "parametric" for all parametric effect sizes. Set to "NOM" for all non-overlap measures. Defaults to calculating the LRRd, LRRi, SMD, and Tau indices.

improvement

character string either indicating the direction of uniform improvement ("increase" or "decrease") or the variable name of a variable identifying the direction of improvement for each series. Default is "increase".

scale

character string indicating the common scale of the outcome variable across all of the series in the data set or the name of a variable within the dataset that identifies the outcome scale within each series. Possible values for the scale are "percentage" for a percentage with range 0-100, "proportion" for a proportion with range 0-1, "count" for a frequency count (0 or positive integers), "rate" for a standardized rate per minute. If a vector, the most frequent unique value will be used and missing values will be ignored. Defaults to NA.

intervals

for interval recording procedures. Either the total number of intervals per observation session common to all series in the dataset, or the name of a variable within the dataset that identifies the number of intervals for each observation. If a variable name, the mean number of intervals within each series will be used. Missing values will be ignored. Defaults to NA.

observation_length

Used for the log-response ratio. Either the common observation session length (in minutes) across all series in the dataset or a variable name containing the observation session length for each observation. If a variable name, the mean observation session length within each series will be used. Missing values will be ignored. Defaults to NA.

goal

Used for the percent of goal obtained. Either a numeric common goal level across all series in the dataset or a variable name containing the goal level for each series. If a variable name, the mean goal level within each series will be used. Missing values will be ignored. Defaults to NULL.

confidence

confidence level for the reported interval estimate. Set to NULL to omit confidence interval calculations.

format

character string specifying whether to organize the results in "long" format or "wide" format. Defaults to "long".

warn

logical indicating whether warnings should be displayed. Default is TRUE.

...

further arguments used for calculating some of the effect size indices.

Details

Calculates one or more effect size indices for each series in a dataset

Value

A tibble containing the estimate, standard error, and/or confidence interval for each specified effect size.

Examples


data(McKissick)
batch_calc_ES(McKissick,
              grouping = Case_pseudonym,
              condition = Condition,
              outcome = Outcome,
              ES = c("LRRd","LRRi"),
              improvement = "decrease",
              scale = "count",
              observation_length = 20,
              format = "long")

data(Schmidt2007)
batch_calc_ES(dat = Schmidt2007,
              grouping = c(Behavior_type, Case_pseudonym, Phase_num),
              condition = Condition,
              outcome = Outcome,
              ES = c("LRRi","LRRd"),
              improvement = direction,
              scale = Metric,
              bias_correct = TRUE,
              confidence = NULL,
              format = "wide")

# Aggregate across phase-pairs
batch_calc_ES(dat = Schmidt2007,
           grouping = c(Behavior_type, Case_pseudonym),
           aggregate = Phase_num,
           weighting = "1/V",
           condition = Condition,
           outcome = Outcome,
           ES = c("LRRi", "LRRd", "SMD", "Tau"),
           improvement = direction,
           scale = "count",
           bias_correct = TRUE,
           confidence = NULL,
           format = "long")


SingleCaseES documentation built on Sept. 11, 2024, 7:04 p.m.