calc_ES: Calculate effect sizes

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

calc_ESR Documentation

Calculate effect sizes

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

calc_ES(
  A_data,
  B_data,
  condition,
  outcome,
  baseline_phase = NULL,
  intervention_phase = NULL,
  ES = c("LRRd", "LRRi", "SMD", "Tau"),
  improvement = "increase",
  ...,
  confidence = 0.95,
  format = "long"
)

Arguments

A_data

vector of numeric data for A phase. Missing values are dropped.

B_data

vector of numeric data for B phase. Missing values are dropped.

condition

vector identifying the treatment condition for each observation in the series.

outcome

vector of outcome data for the entire series.

baseline_phase

character string specifying which value of condition corresponds to the baseline phase. Defaults to first observed value of condition.

intervention_phase

character string specifying which value of condition corresponds to the intervention phase. Defaults to second unique value of condition.

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 indicating direction of improvement. Default is "increase".

...

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

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".

Details

Calculates one or more effect size indices

Value

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

Examples

# Using the A_data and B_data arguments
A <- c(20, 20, 26, 25, 22, 23)
B <- c(28, 25, 24, 27, 30, 30, 29)
calc_ES(A_data = A, B_data = B)

# Using the condition and outcome arguments
phase <- c(rep("A", length(A)), rep("B", length(B)))
outcome <- c(A, B)
calc_ES(condition = phase, outcome = outcome, baseline_phase = "A")

# Example from Parker & Vannest (2009)
yA <- c(4, 3, 4, 3, 4, 7, 5, 2, 3, 2)
yB <- c(5, 9, 7, 9, 7, 5, 9, 11, 11, 10, 9)
calc_ES(yA, yB)


SingleCaseES documentation built on Aug. 12, 2023, 5:13 p.m.