Calculates the log ratio of medians effect size index

LRM(
A_data,
B_data,
condition,
outcome,
baseline_phase = NULL,
intervention_phase = NULL,
improvement = "increase",
delta_method = FALSE,
confidence = 0.95
)

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

improvement

character string indicating direction of improvement. Default is "increase".

delta_method

logical value indicating whether to use delta method to approximate variance of log ratio of medians. Default is FALSE, which estimates the variance based on the fact that the logarithm of a median is the same as the median of the log-transformed outcomes. If TRUE, the variance of log ratio of medians is approximated using delta method.

confidence

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

## Value

A data frame containing the estimate, standard error, and confidence interval.

## Details

The ratio of medians effect size parameter is defined as the ratio of the medians of the outcomes in different phases. The log ratio of the medians is the natural logarithm of the ratio of medians. This effect size is appropriate for outcomes that are skewed, symmetric but highly leptokurtic, or right-censored (Bonett & Price Jr, 2020).

## Examples

A <- c(20, 20, 26, 25, 22, 23)
B <- c(28, 25, 24, 27, 30, 30, 29)
LRM(A_data = A, B_data = B)
#>    ES       Est         SE   CI_lower  CI_upper
#> 1 LRM 0.2186892 0.07641543 0.06891771 0.3684607