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

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

Value

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

Details

Calculates one or more effect size indices

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)
#>     ES        Est         SE    CI_lower    CI_upper baseline_SD
#> 1 LRRd -0.1953962 0.05557723 -0.30432554 -0.08646679          NA
#> 2 LRRi  0.1953962 0.05557723  0.08646679  0.30432554          NA
#> 3  SMD  1.6499319 0.63409351  0.40713144  2.89273232    2.503331
#> 4  Tau  0.8333333 0.13801311  0.19468122  0.97203517          NA

# 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")
#>     ES        Est         SE    CI_lower    CI_upper baseline_SD
#> 1 LRRd -0.1953962 0.05557723 -0.30432554 -0.08646679          NA
#> 2 LRRi  0.1953962 0.05557723  0.08646679  0.30432554          NA
#> 3  SMD  1.6499319 0.63409351  0.40713144  2.89273232    2.503331
#> 4  Tau  0.8333333 0.13801311  0.19468122  0.97203517          NA

# 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)
#>     ES        Est         SE   CI_lower   CI_upper baseline_SD
#> 1 LRRd -0.8102983 0.14867023 -1.1016866 -0.5189100          NA
#> 2 LRRi  0.8102983 0.14867023  0.5189100  1.1016866          NA
#> 3  SMD  2.8531844 0.78308117  1.3183735  4.3879953    1.494434
#> 4  Tau  0.9272727 0.06385245  0.4999482  0.9901458          NA