| Type: | Package |
| Title: | Meta-Analysis of Quantiles and Functions of Quantiles |
| Version: | 0.1.3 |
| Maintainer: | Udara Kumaranathunga <U.Kumaranathunga@latrobe.edu.au> |
| Author: | Udara Kumaranathunga [aut, cre], Alysha De Livera [aut], Luke Prendergast [aut] |
| Description: | Implements a novel density-based approach for estimating unknown parameters, distribution visualisations and meta-analyses of quantiles and ther functions. A detailed vignettes with example datasets and code to prepare data and analyses is available at https://bookdown.org/a2delivera/metaquant/. The methods are described in the pre-print by De Livera, Prendergast and Kumaranathunga (2024, <doi:10.48550/arXiv.2411.10971>). |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Depends: | R (≥ 3.5.0) |
| RoxygenNote: | 7.3.2 |
| Imports: | gld, sld, stats, ggplot2, plotly, magrittr, dplyr, estmeansd, metafor |
| NeedsCompilation: | no |
| Packaged: | 2025-11-09 06:37:53 UTC; 22102238 |
| Repository: | CRAN |
| Date/Publication: | 2025-11-09 10:10:02 UTC |
Estimating Unknown Parameters using Five-Number Summary
Description
This function provide estimates for the parameters of generalised lambda distribution (GLD), the sample mean and the standard deviation using 5-number summary {minimum, first quartile, median, third quartile, maximum} from a study with sample size n,
using the method explained in De Livera et al. (2024).
Usage
est.gld.five(
min = NULL,
q1 = NULL,
med = NULL,
q3 = NULL,
max = NULL,
n = NULL,
opt = TRUE
)
Arguments
min |
numeric value representing the sample minimum. |
q1 |
numeric value representing the first quartile of the sample. |
med |
numeric value representing the median of the sample. |
q3 |
numeric value representing the third quartile of the sample. |
max |
numeric value representing the sample maximum. |
n |
numeric value specifying the sample size. |
opt |
logical value indicating whether to apply the optimisation step in estimating parameters using theoretical quantiles.
The default value is |
Details
De Livera et al. (2024) proposed using the generalised lambda distribution (GLD) to estimate unknown parameters for studies reporting 5-number summaries in the meta-analysis context.
The GLD is a four parameter family of distributions defined by its quantile function under the FKML parameterisation (Freimer et al., 1988).
De Livera et al. propose that the GLD quantlie function can be used to approximate a sample's distribution using 5-point summaries.
The four parameters of GLD quantile function include: a location parameter (\lambda_1), an inverse scale parameter (\lambda_2>0), and two shape parameters (\lambda_3 and \lambda_4).
The parameters of the GLD are estimated by formulating and solving a set of simultaneous equations which relate the estimated sample quantiles to their theoretical counterparts of the GLD.
Value
A list with following components:
-
parameters: named numeric vector representing the estimated parameters ('location', 'inverse scale', 'shape 1', 'shape 2') of GLD . -
mean: numeric value of the estimated mean of the sample using GLD. -
sd: numeric value of the estimated standard deviation of the sample using GLD.
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.
Freimer, M., Kollia, G., Mudholkar, G. S., & Lin, C. T. (1988). A study of the generalized Tukey lambda family. Communications in Statistics—Theory and Methods, 17(10), 3547–3567.
Gilchrist, W. (2000). Statistical modelling with quantile functions. Chapman & Hall/CRC.
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.
See Also
est.sld.minq2max(), est.sld.q1q2q3()
Examples
#Generate 5-number summary data
set.seed(123)
n <- 1000
x <- stats::rlnorm(n, 4, 0.3)
quants <- c(min(x), stats::quantile(x, probs = c(0.25, 0.5, 0.75)), max(x))
#Estimate GLD parameters using 5-number summary
params<- est.gld.five(min = quants[1], q1 = quants[2], med = quants[3], q3 = quants[4],
max = quants[5], n=n, opt=TRUE)$parameters
params
Estimating Sample Mean using Quantiles
Description
This function estimates the sample mean from a study presenting quantile summary measures with the sample size (n). The quantile summaries can fall into one of the following categories:
-
S_1: { minimum, median, maximum } -
S_2: { first quartile, median, third quartile } -
S_3: { minimum, first quartile, median, third quartile, maximum }
The est.mean function implements newly proposed flexible quantile-based distribution methods for estimating sample mean (De Livera et al., 2024).
It also incorporates existing methods for estimating sample means as described by Luo et al. (2018) and McGrath et al. (2020).
Usage
est.mean(
min = NULL,
q1 = NULL,
med = NULL,
q3 = NULL,
max = NULL,
n = NULL,
method = "gld/sld",
opt = TRUE
)
Arguments
min |
numeric value representing the sample minimum. |
q1 |
numeric value representing the first quartile of the sample. |
med |
numeric value representing the median of the sample. |
q3 |
numeric value representing the third quartile of the sample. |
max |
numeric value representing the sample maximum. |
n |
numeric value specifying the sample size. |
method |
character string specifying the approach used to estimate the sample means. The options are the following:
|
opt |
logical value indicating whether to apply the optimisation step of |
Details
The 'gld/sld' method (i.e., the method of De Livera et al., (2024)) of est.mean uses the following quantile based distributions:
Generalised Lambda Distribution (GLD) for estimating the sample mean using 5-number summaries (
S_3).Skew Logistic Distribution (SLD) for estimating the sample mean using 3-number summaries (
S_1andS_2).
The generalised lambda distribution (GLD) is a four parameter family of distributions defined by its quantile function under the FKML parameterisation (Freimer et al., 1988).
De Livera et al. propose that the GLD quantlie function can be used to approximate a sample's distribution using 5-point summaries.
The four parameters of GLD quantile function include: a location parameter (\lambda_1), an inverse scale parameter (\lambda_2>0), and two shape parameters (\lambda_3 and \lambda_4).
The quantile-based skew logistic distribution (SLD), introduced by Gilchrist (2000) and further modified by van Staden and King (2015)
is used to approximate the sample's distribution using 3-point summaries.
The SLD quantile function is defined using three parameters: a location parameter (\lambda), a scale parameter (\eta), and a skewing parameter (\delta).
For 'gld/sld' method, the parameters of the GLD and SLD are estimated
by formulating and solving a set of simultaneous equations. These equations relate the estimated sample quantiles to their theoretical counterparts
of the respective distribution (GLD or SLD). Finally, the mean for each scenario is calculated by integrating functions of the estimated quantile function.
Value
mean: numeric value representing the estimated mean of the sample.
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.
Luo, D., Wan, X., Liu, J., & Tong, T. (2018). Optimally estimating the sample mean from the sample size, median, mid-range, and/or mid-quartile range. Statistical methods in medical research, 27(6), 1785-1805.
Wan, X., Wang, W., Liu, J., & Tong, T. (2014). Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology, 14, 1–13.
McGrath, S., Zhao, X., Steele, R., Thombs, B. D., Benedetti, A., & the DEPRESSD Collaboration. (2020b). Estimating the sample mean and standard deviation from commonly reported quantiles in meta-analysis. Statistical Methods in Medical Research, 29(9), 2520–2537.
Freimer, M., Kollia, G., Mudholkar, G. S., & Lin, C. T. (1988). A study of the generalized Tukey lambda family. Communications in Statistics—Theory and Methods, 17(10), 3547–3567.
Gilchrist, W. (2000). Statistical modelling with quantile functions. Chapman & Hall/CRC.
van Staden, P. J., & King, R. A. R. (2015). The quantile-based skew logistic distribution. Statistics & Probability Letters, 96, 109–116.
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.
King, R., & van Staden, P. (2022). sld: Estimation and use of the Quantile-Based Skew Logistic Distribution (R package Version 1.0.1). Comprehensive R Archive Network (CRAN). https://doi.org/10.32614/CRAN.package.sld. https://CRAN.R-project.org/package=sld.
Examples
#Generate 5-point summary data
set.seed(123)
n <- 1000
x <- stats::rlnorm(n, 4, 0.3)
quants <- c(min(x), stats::quantile(x, probs = c(0.25, 0.5, 0.75)), max(x))
obs_mean <- mean(x)
#Estimate sample mean using s3 (5 number summary)
est_mean_s3 <- est.mean(min = quants[1], q1 = quants[2], med = quants[3], q3 = quants[4],
max = quants[5], n=n, method = "gld/sld")
est_mean_s3
#Estimate sample mean using s1 (min, median, max)
est_mean_s1 <- est.mean(min = quants[1], med = quants[3], max = quants[5],
n=n, method = "gld/sld")
est_mean_s1
#Estimate sample mean using s2 (q1, median, q3)
est_mean_s2 <- est.mean(q1 = quants[2], med = quants[3], q3 = quants[4],
n=n, method = "gld/sld")
est_mean_s2
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()
)
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:
|
effect.size.type |
character string specifying the quantile-based effect size for the meta-analysis. Options:
|
opt |
logical; whether to apply the optimisation step of the
|
single.family |
logical; for two-group studies using the |
qe.fit.control.g1 |
optional list of control parameters for
|
qe.fit.control.g2 |
optional list of control parameters for
|
Value
A list containing following components:
-
effect.size: numeric value of quantile-based effect size of the study based on the input ofeffect.size.typeargument. -
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 onnumber.of.groupsandeffect.size.type.
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
Examples
#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")
Estimating Variances of Squared IQR Ratio and its Natural Logarithm
Description
This function estimates the variances of squared IQR ratio and its logarithm for two-group studies, from studies that report five-number summaries (minimum, first quartile, median, third quartile, maximum) and sample sizes, using density-based approaches.
The est.r.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:
Ratio of squared interquartile ranges (IQRs) between two groups:
r = (q_{3g1}-q_{1g1})^2 / (q_{3g2}-q_{1g2})^2.Log ratio of squared IQRs between two groups:
log(r).
Portions of this implementation are adapted from
qe.study.level
for the QE method, and have been extended to support functions of quantiles
beyond the median.
Usage
est.r.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,
opt = TRUE,
single.family = FALSE,
qe.fit.control.g1 = list(),
qe.fit.control.g2 = list()
)
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 squared IQR ratio and its natural logarithm. Options:
|
opt |
logical; whether to apply the optimisation step of the
|
single.family |
logical; for two-group studies using the |
qe.fit.control.g1 |
optional list of control parameters for
|
qe.fit.control.g2 |
optional list of control parameters for
|
Value
A list containing following components:
-
effect.size: numeric value of the effect size of the study (ratio of squared IQRs). -
estvar: estimated variance of the effect size (ratio of squared IQRs). -
effect.size.log: numeric value of log ratio of squared IQRs. -
estvar.log: estimated variance of log ratio of squared IQRs. -
number.of.groups: integer indicating the number of groups in the input study data.
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
Examples
#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))
#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 squared IQR ratio and its natural logarithm (for two groups)
est.r.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")
Estimating Sample Standard Deviation using Quantiles
Description
This function estimates the sample standard deviation from a study presenting quantile summary measures with the sample size (n). The quantile summaries can fall into one of the following categories:
-
S_1: { minimum, median, maximum } -
S_2: { first quartile, median, third quartile } -
S_3: { minimum, first quartile, median, third quartile, maximum }
The est.sd function implements newly proposed flexible quantile-based distribution methods for estimating sample standard deviation by De Livera et al. (2024)
as well as other existing methods for estimating sample standard deviations by Shi et al. (2020) and McGrath et al. (2020).
Usage
est.sd(
min = NULL,
q1 = NULL,
med = NULL,
q3 = NULL,
max = NULL,
n = NULL,
method = "shi/wan",
opt = TRUE
)
Arguments
min |
numeric value representing the sample minimum. |
q1 |
numeric value representing the first quartile of the sample. |
med |
numeric value representing the median of the sample. |
q3 |
numeric value representing the third quartile of the sample. |
max |
numeric value representing the sample maximum. |
n |
numeric value specifying the sample size. |
method |
character string specifying the approach used to estimate the sample standard deviations. The options are the following:
|
opt |
logical value indicating whether to apply the optimisation step of |
Details
For details explaining the new method 'gld/sld', check est.mean.
Value
sd: numeric value representing the estimated standard deviation of the sample.
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.
Shi, J., Luo, D., Weng, H., Zeng, X.-T., Lin, L., Chu, H., & Tong, T. (2020). Optimally estimating the sample standard deviation from the five-number summary. Research Synthesis Methods, 11(5), 641–654.
Wan, X., Wang, W., Liu, J., & Tong, T. (2014). Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology, 14, 1–13.
McGrath, S., Zhao, X., Steele, R., Thombs, B. D., Benedetti, A., & the DEPRESSD Collaboration. (2020b). Estimating the sample mean and standard deviation from commonly reported quantiles in meta-analysis. Statistical Methods in Medical Research, 29(9), 2520–2537.
Examples
#Generate 5-point summary data
set.seed(123)
n <- 1000
x <- stats::rlnorm(n, 5, 0.5)
quants <- c(min(x), stats::quantile(x, probs = c(0.25, 0.5, 0.75)), max(x))
obs_sd <- sd(x)
#Estimate sample SD using s3 (5 number summary)
est_sd_s3 <- est.sd(min = quants[1], q1 = quants[2], med = quants[3], q3 = quants[4],
max = quants[5], n=n, method = "gld/sld")
est_sd_s3
#Estimate sample SD using s1 (min, median, max)
est_sd_s1 <- est.sd(min = quants[1], med = quants[3], max = quants[5],
n=n, method = "gld/sld")
est_sd_s1
#Estimate sample SD using s2 (q1, median, q3)
est_sd_s2 <- est.sd(q1 = quants[2], med = quants[3], q3 = quants[4],
n=n, method = "gld/sld")
est_sd_s2
Estimating Unknown Parameters using Minimum, Median and Maximum
Description
This function provide estimates for the parameters of skew logistic distribution (SLD), the sample mean and the standard deviation using 3-number summary {minimum, median (q_2), maximum} from a study with sample size n,
using the method explained in De Livera et al. (2024).
Usage
est.sld.minq2max(
min = NULL,
med = NULL,
max = NULL,
n = NULL,
opt = TRUE
)
Arguments
min |
numeric value representing the sample minimum. |
med |
numeric value representing the median of the sample. |
max |
numeric value representing the sample maximum. |
n |
numeric value specifying the sample size. |
opt |
logical value indicating whether to apply the optimisation step in estimating parameters using theoretical quantiles.
The default value is |
Details
De Livera et al. (2024) proposed using the skew logistic distribution (SLD) to estimate unknown parameters for studies reporting 3-number summaries in the meta-analysis context.
The quantile-based skew logistic distribution, introduced by Gilchrist (2000) and further modified by van Staden and King (2015)
is used to approximate the sample's distribution using 3-point summaries.
The SLD quantile function is defined using three parameters: a location parameter (\lambda), a scale parameter (\eta), and a skewing parameter (\delta).
The parameters of the SLD are estimated by formulating and solving a set of simultaneous equations which relate the estimated sample quantiles to their theoretical counterparts of the SLD.
Value
A list with following components:
-
parameters: named numeric vector representing the estimated parameters ('location', 'scale', 'skewing') of SLD. -
mean: numeric value of the estimated mean of the sample using SLD. -
sd: numeric value of the estimated standard deviation of the sample using SLD.
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.
Gilchrist, W. (2000). Statistical modelling with quantile functions. Chapman & Hall/CRC.
van Staden, P. J., & King, R. A. R. (2015). The quantile-based skew logistic distribution. Statistics & Probability Letters, 96, 109–116.
King, R., & van Staden, P. (2022). sld: Estimation and use of the Quantile-Based Skew Logistic Distribution (R package Version 1.0.1). Comprehensive R Archive Network (CRAN). https://doi.org/10.32614/CRAN.package.sld. https://CRAN.R-project.org/package=sld.
See Also
est.gld.five(), est.sld.q1q2q3()
Examples
#Generate 3-number summary data
set.seed(123)
n <- 1000
x <- stats::rlnorm(n, 4, 0.3)
quants <- c(min(x), stats::quantile(x, probs = 0.5), max(x))
#Estimate SLD parameters using 3-number summary
params <- est.sld.minq2max(min = quants[1], med = quants[2], max = quants[3],
n=n, opt=TRUE)$parameters
params
Estimating Unknown Parameters using First Quartile, Median and Third Quartile
Description
This function provide estimates for the parameters of skew logistic distribution (SLD), the sample mean and the standard deviation using 3-number summary {first quartile (q_1), median (q_2), third quartile (q_3)} from a study with sample size n,
using the method explained in De Livera et al. (2024).
Usage
est.sld.q1q2q3(
q1 = NULL,
med = NULL,
q3 = NULL,
n = NULL,
opt = TRUE
)
Arguments
q1 |
numeric value representing the first quartile of the sample. |
med |
numeric value representing the median of the sample. |
q3 |
numeric value representing the third quartile of the sample. |
n |
numeric value specifying the sample size. |
opt |
logical value indicating whether to apply the optimisation step in estimating parameters using theoretical quantiles.
The default value is |
Details
De Livera et al. (2024) proposed using the skew logistic distribution (SLD) to estimate unknown parameters for studies reporting 3-number summaries in the meta-analysis context.
The quantile-based skew logistic distribution, introduced by Gilchrist (2000) and further modified by van Staden and King (2015)
is used to approximate the sample's distribution using 3-point summaries.
The SLD quantile function is defined using three parameters: a location parameter (\lambda), a scale parameter (\eta), and a skewing parameter (\delta).
The parameters of the SLD are estimated by formulating and solving a set of simultaneous equations which relate the estimated sample quantiles to their theoretical counterparts of the SLD.
Value
A list with following components:
-
parameters: named numeric vector representing the estimated parameters ('location', 'scale', 'skewing') of SLD. -
mean: numeric value of the estimated mean of the sample using SLD. -
sd: numeric value of the estimated standard deviation of the sample using SLD.
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.
Gilchrist, W. (2000). Statistical modelling with quantile functions. Chapman & Hall/CRC.
van Staden, P. J., & King, R. A. R. (2015). The quantile-based skew logistic distribution. Statistics & Probability Letters, 96, 109–116.
King, R., & van Staden, P. (2022). sld: Estimation and use of the Quantile-Based Skew Logistic Distribution (R package Version 1.0.1). Comprehensive R Archive Network (CRAN). https://doi.org/10.32614/CRAN.package.sld. https://CRAN.R-project.org/package=sld.#'
See Also
est.gld.five(), est.sld.minq2max()
Examples
#Generate 3-number summary data
set.seed(123)
n <- 1000
x <- stats::rlnorm(n, 4, 0.3)
quants <- c(stats::quantile(x, probs = c(0.25, 0.5, 0.75)))
#Estimate SLD parameters using 3-number summary
params<- est.sld.q1q2q3(q1 = quants[1], med = quants[2], q3 = quants[3],
n=n, opt=TRUE)$parameters
params
Meta-Analysis of Quantiles and Functions of Quantiles
Description
This function implements statistical methods for meta-analysis of quantiles and functions of quantiles for single-group and two-group studies. The function uses inverse-variance weighting to synthesise information from studies that report five-number summaries (minimum, first quartile, median, third quartile, maximum) and sample sizes—particularly useful for skewed outcomes.
The metaquant function currently supports two density-based frameworks:
(1) a Generalized Lambda Distribution (GLD) fitted via percentile matching,
following De Livera et al. (2024), to estimate parameters for meta-analysis of
medians and other quantiles; and (2) an extension of the Quantile Estimation
(QE) method of McGrath et al. (2020) to additional quantiles and functions of
quantiles, with derived standard errors for inverse-variance pooling.
The function facilitates meta-analyses 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}).Ratio of squared interquartile ranges (IQRs) between two groups:
r = (q_{3g1}-q_{1g1})^2 / (q_{3g2}-q_{1g2})^2.
Portions of this implementation are adapted from
metamedian for the QE
method, and have been extended to support other quantiles and functions of
quantiles beyond the median.
Usage
metaquant(
data,
method = "gld",
effect.size.type = "median",
opt = TRUE,
single.family = FALSE,
pool.studies = TRUE,
...)
Arguments
data |
a data frame with one row per study containing five-number summaries and sample sizes. For one-group studies, the input should contain the following columns:
For two-group studies, also include the corresponding columns for the second
group: |
method |
character string specifying the density-based approach used to perform the meta analysis of quantiles or their functions. Options:
|
effect.size.type |
character string specifying the quantile-based effect size for the meta-analysis. Options:
|
opt |
logical; whether to apply the optimisation step of the
|
single.family |
logical; for two-group studies using the |
pool.studies |
logical; whether to pool study-specific effect sizes via
inverse-variance–weighted meta-analysis. Default is |
... |
additional arguments passed to
|
Value
An object of class "rma.uni" or a list of effect sizes and their estimated variances.
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
Examples
# Example dataset of 5-number summaries (min, q1, med, q3, max) for 2 groups
data_2g <- data.frame(
study.index = c("Study1", "Study2", "Study3"),
min.g1 = c(15, 15, 13),
q1.g1 = c(57, 59, 55),
med.g1 = c(66, 68, 60),
q3.g1 = c(74, 72, 69),
max.g1 = c(108, 101, 100),
n.g1 = c(226, 230, 200),
min.g2 = c(18, 19, 15),
q1.g2 = c(66, 71, 69),
med.g2 = c(73, 82, 81),
q3.g2 = c(80, 93, 89),
max.g2 = c(110, 115, 100),
n.g2 = c(226, 230, 200)
)
print(data_2g)
# Meta-analysis of difference in first quartiles
metaquant(data = data_2g, method = "gld", effect.size.type = "q1")
metaquant(data = data_2g, method = "qe", effect.size.type = "q1")
# Meta-analysis of log ratio of squared IQRs
ma_lr <- metaquant(data = data_2g, method = "gld", effect.size.type = "logr2")
# Back-transform to original scale (ratio of squared IQRs)
est_r <- exp(ma_lr$b) # pooled estimate
ci_r <- exp(c(ma_lr$ci.lb, ma_lr$ci.ub)) # confidence interval
pi_r <- exp(c(predict(ma_lr)$pi.lb, predict(ma_lr)$pi.ub)) # prediction interval
est_r; ci_r; pi_r
Visualising Densities using Quantiles
Description
The function estimates and visualizes the density curves of one-group or two-group studies presenting quantile summary measures with the sample size (n). The quantile summaries can fall into one of the following categories:
-
S_1: { minimum, median, maximum } -
S_2: { first quartile, median, third quartile } -
S_3: { minimum, first quartile, median, third quartile, maximum }
The plotdist function uses the following quantile-based distribution methods for visualising densities using qantiles (De Livera et al., 2024).
Generalised Lambda Distribution (GLD) when 5-number summaries present (
S_3).Skew Logistic Distribution (SLD) when 3-number summaries present (
S_1andS_2).
Usage
plotdist(
data,
xmin = NULL,
xmax = NULL,
ymax = NULL,
length.out = 1000,
title = "",
xlab = "x",
ylab = "Density",
line.size = 0.5,
title.size = 12,
lab.size = 10,
color.g1 = "pink",
color.g2 = "skyblue",
color.g1.pooled = "red",
color.g2.pooled = "blue",
label.g1 = NULL,
label.g2 = NULL,
display.index = FALSE,
display.legend = FALSE,
pooled.dist = FALSE,
pooled.only = FALSE,
opt = TRUE
)
Arguments
data |
data frame containing the quantile summary data. For one-group studies, the input may contain the following columns depending on the quantile scenario:
For two-group studies, the data frame may also contain the following columns for the second group: |
xmin |
numeric value for the lower limit of the x-axis for density calculation. It is recommended to set this to a value smaller than the smallest value across the quantile summaries to ensure the density curve is fully captured.
If |
xmax |
numeric value for the upper limit of the x-axis for density calculation. It is recommended to set this to a value larger than the largest value across the quantile summaries to ensure the density curve is fully captured.
If |
ymax |
numeric value for the upper limit of the y-axis. If NULL, the highest density value will be used. |
length.out |
integer specifying the number of points along the x-axis for density calculation. Default is |
title |
character string for the plot title. Default is an empty string. |
xlab |
character string for the x-axis label. Default is |
ylab |
character string for the y-axis label. Default is |
line.size |
numeric. Thickness of the density curve lines. Default is |
title.size |
numeric. Font size for the plot title. Default is |
lab.size |
numeric. Font size for axis labels. Default is |
color.g1 |
character string specifying the color for individual density curves of group 1 for each study (row). Default is |
color.g2 |
character string specifying the color for individual density curves of group 2 for each study (row). Default is |
color.g1.pooled |
character string specifying the color for pooled density curve of group 1. Default is |
color.g2.pooled |
character string specifying the color for pooled density curve of group 2. Default is |
label.g1 |
character string indicating label or name for group 1 (eg., 'Treatment') |
label.g2 |
character string indicating label or name for group 2 (eg., 'Control'). If |
display.index |
logical. If |
display.legend |
logical. If |
pooled.dist |
logical. If |
pooled.only |
logical. If |
opt |
logical value indicating whether to apply the optimization step when estimating GLD or SLD parameters. The default value is |
Details
The generalised lambda distribution (GLD) is a four parameter family of distributions defined by its quantile function under the FKML parameterisation (Freimer et al., 1988).
De Livera et al. propose that the GLD quantile function can be used to approximate a sample's distribution using 5-point summaries.
The four parameters of GLD quantile function include: a location parameter (\lambda_1), an inverse scale parameter (\lambda_2>0), and two shape parameters (\lambda_3 and \lambda_4).
The quantile-based skew logistic distribution (SLD), introduced by Gilchrist (2000) and further modified by van Staden and King (2015)
is used to approximate the sample's distribution using 3-point summaries.
The SLD quantile function is defined using three parameters: a location parameter (\lambda), a scale parameter (\eta), and a skewing parameter (\delta).
These parameters of GLD and SLD are estimated by formulating and solving a series of simultaneous equations which relate the estimated quantiles
with the population counterparts of respective distribution (GLD or SLD). The plotdist uses these estimated parameters, to compute the density data
using dgl function from the gld package and dsl function from the sld package.
If one needs to generate pooled density plots, they can use the pooled.dist or pooled.only arguments as described in the Arguments section.
The pooled density curves represent a weighted average of individual study densities, with weights determined by sample sizes. The method is similar to obtaining pooled
estimates of effects in a standard meta-analysis and it serves as a way to visualize combined estimated distributional information across studies.
Value
An interactive plotly object visualizing the estimated density curve(s) for one or two groups.
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.
Freimer, M., Kollia, G., Mudholkar, G. S., & Lin, C. T. (1988). A study of the generalized Tukey lambda family. Communications in Statistics—Theory and Methods, 17(10), 3547–3567.
Gilchrist, W. (2000). Statistical modelling with quantile functions. Chapman & Hall/CRC.
van Staden, P. J., & King, R. A. R. (2015). The quantile-based skew logistic distribution. Statistics & Probability Letters, 96, 109–116.
Examples
#Example dataset of 3-point summaries (min, med, max) for 2 groups
data_3num_2g <- data.frame(
study.index = c("Study 1", "Study 2", "Study 3"),
min.g1 = c(15, 15, 13),
med.g1 = c(66, 68, 63),
max.g1 = c(108, 101, 100),
n.g1 = c(226, 230, 200),
min.g2 = c(18, 19, 15),
med.g2 = c(73, 82, 81),
max.g2 = c(110, 115, 100),
n.g2 = c(226, 230, 200)
)
print(data_3num_2g)
#Density plots of two groups along with the pooled plots
plot_2g <- plotdist(
data_3num_2g,
xmin = 10,
xmax = 125,
title = "Example Density Plots of Two Groups",
xlab = "x data",
color.g1 = "skyblue",
color.g2 = "pink",
color.g1.pooled = "blue",
color.g2.pooled = "red",
label.g1 = "Treatment",
label.g2 = "Control",
display.legend = TRUE,
pooled.dist = TRUE
)
print(plot_2g)