Learn R Programming

metaquant (version 0.1.3)

est.q.study.level: Estimating Quantile-Based Effect Sizes and Variances

Description

This function estimates the variances of quantiles and the differences of quantiles for single-group and two-group studies, respectively, from studies that report five-number summaries (minimum, first quartile, median, third quartile, maximum) and sample sizes, using density-based approaches.

The est.q.study.level function currently supports two density-based frameworks: (1) a Generalized Lambda Distribution (GLD) fitted via percentile matching, following De Livera et al. (2024); and (2) an extension of the Quantile Estimation (QE) method of McGrath et al. (2020) to additional quantiles and functions of quantiles.

The function estimates the asymptotic variances of the following effect sizes:

  • Single-group quantiles: median (\(m\)), first quartile (\(q_1\)), third quartile (\(q_3\)).

  • Two-group differences in quantiles: difference in medians (\(m_{g1}-m_{g2}\)), difference in first quartiles (\(q_{1g1}-q_{1g2}\)), difference in third quartiles (\(q_{3g1}-q_{3g2}\)).

Portions of this implementation are adapted from qe.study.level for the QE method, and have been extended to support other quantiles and functions of quantiles beyond the median.

Usage

est.q.study.level(
   min.g1, 
   q1.g1, 
   med.g1, 
   q3.g1, 
   max.g1, 
   n.g1, 
   min.g2, 
   q1.g2, 
   med.g2, 
   q3.g2, 
   max.g2, 
   n.g2,
   method, 
   effect.size.type, 
   opt = TRUE, 
   single.family = FALSE, 
   qe.fit.control.g1 = list(), 
   qe.fit.control.g2 = list()
 )

Value

A list containing following components:

  • effect.size: numeric value of quantile-based effect size of the study based on the input of effect.size.type argument.

  • estvar: numeric value of the estimated variance of the effect size.

  • number.of.groups: integer indicating the number of groups in the input study data.

  • effect.size.name: character string specifying a label for the effect size depending on number.of.groups and effect.size.type.

Arguments

min.g1

numeric value representing the sample minimum (of group one for two-group studies).

q1.g1

numeric value representing the first quartile of the sample (of group one for two-group studies).

med.g1

numeric value representing the median of the sample (of group one for two-group studies).

q3.g1

numeric value representing the third quartile of the sample (of group one for two-group studies).

max.g1

numeric value representing the sample maximum (of group one for two-group studies).

n.g1

numeric value specifying the sample size (of group one for two-group studies).

min.g2

numeric value representing the sample minimum of group two for two-group studies.

q1.g2

numeric value representing the first quartile of the sample of group two for two-group studies.

med.g2

numeric value representing the median of the sample of group two for two-group studies.

q3.g2

numeric value representing the third quartile of the sample of group two for two-group studies.

max.g2

numeric value representing the sample maximum of group two for two-group studies.

n.g2

numeric value specifying the sample size of group two for two-group studies.

method

character string specifying the density-based approach used to estimate variances of quantiles or their functions. Options:

'gld'

The default option. Estimation method proposed by De Livera et al. (2024) using the generalised lambda distribution (GLD).

'qe'

Quantile Matching Estimation method proposed by McGrath et al. (2020).

effect.size.type

character string specifying the quantile-based effect size for the meta-analysis. Options:

'median'

The default option. Median for single-group studies; difference in medians for two-group studies.

'q1'

First quartile for single-group studies; difference in first quartiles for two-group studies.

'q3'

Third quartile for single-group studies; difference in third quartiles for two-group studies.

opt

logical; whether to apply the optimisation step of the "gld" method when estimating its parameters. Default is TRUE.

single.family

logical; for two-group studies using the "qe" method, whether to assume the same parametric family of distributions for both groups. Default is FALSE. See qe.study.level

qe.fit.control.g1

optional list of control parameters for qe.fit (of group one for two-group studies).

qe.fit.control.g2

optional list of control parameters for qe.fit of group two for two-group studies.

References

De Livera, A. M., Prendergast, L., & Kumaranathunga, U. (2024). A novel density-based approach for estimating unknown means, distribution visualisations and meta-analyses of quantiles. arXiv preprint arXiv:2411.10971. https://arxiv.org/abs/2411.10971.

King, R., Dean, B., Klinke, S., & van Staden, P. (2025). gld: Estimation and use of the Generalised (Tukey) Lambda Distribution (R package Version 2.6.7). Comprehensive R Archive Network (CRAN). https://doi.org/10.32614/CRAN.package.gld. https://CRAN.R-project.org/package=gld.

McGrath, S., Sohn, H., Steele, R., & Benedetti, A. (2020). Meta‐analysis of the difference of medians. Biometrical Journal, 62(1), 69-98.

McGrath, S., Zhao, X., Ozturk, O., Katzenschlager, S., Steele, R., & Benedetti, A. (2024). Metamedian: an R package for meta‐analyzing studies reporting medians. Research Synthesis Methods, 15(2), 332-346.

See Also

est.r.study.level()

Examples

Run this code
#Generate 5-number summary data (group one)
set.seed(123)
n1 <- 100
x1 <- stats::rlnorm(n1, 4, 0.3)
quants1 <- c(min(x1), stats::quantile(x1, probs = c(0.25, 0.5, 0.75)), max(x1))

#Estimate variance of the first quartile
est.q.study.level(min.g1 = quants1[1], q1.g1 = quants1[2], med.g1 = quants1[3], 
                  q3.g1 = quants1[4],max.g1 = quants1[5], n.g1=n1, 
                  method = "gld", effect.size.type = "q1")

#Generate 5-number summary data (group two)
set.seed(123) 
n2 <- 120
x2 <- stats::rlnorm(n2, 3, 0.5)
quants2 <- c(min(x2), stats::quantile(x2, probs = c(0.25, 0.5, 0.75)), max(x2))

#Estimate variance of the difference in first quartiles (for two groups)
est.q.study.level(min.g1 = quants1[1], q1.g1 = quants1[2], med.g1 = quants1[3], 
                  q3.g1 = quants1[4], max.g1 = quants1[5], n.g1=n1, 
                  min.g2 = quants2[1], q1.g2 = quants2[2], med.g2 = quants2[3], 
                  q3.g2 = quants2[4],  max.g2 = quants2[5], n.g2=n2, 
                  method = "gld", effect.size.type = "q1")
                 
                 

Run the code above in your browser using DataLab