Package 'fragility'

Title: Assessing and Visualizing Fragility of Clinical Results with Binary Outcomes
Description: A collection of user-friendly functions for assessing and visualizing fragility of individual studies (Walsh et al., 2014 <doi:10.1016/j.jclinepi.2013.10.019>; Lin, 2021 <doi:10.1111/jep.13428>), conventional pairwise meta-analyses (Atal et al., 2019 <doi:10.1016/j.jclinepi.2019.03.012>), and network meta-analyses of multiple treatments with binary outcomes (Xing et al., 2020 <doi:10.1016/j.jclinepi.2020.07.003>). The included functions are designed to: 1) calculate the fragility index (i.e., the minimal event status modifications that can alter the significance or non-significance of the original result) and fragility quotient (i.e., fragility index divided by sample size) at a specific significance level; 2) give the cases of event status modifications for altering the result's significance or non-significance and visualize these cases; 3) visualize the trend of statistical significance as event status is modified; 4) efficiently derive fragility indexes and fragility quotients at multiple significance levels, and visualize the relationship between these fragility measures against the significance levels; and 5) calculate fragility indexes and fragility quotients of multiple datasets (e.g., a collection of clinical trials or meta-analyses) and produce plots of their overall distributions. The outputs from these functions may inform the robustness of clinical results in terms of statistical significance and aid the interpretation of fragility measures. The usage of this package is illustrated in Lin et al. (2023 <doi:10.1016/j.ajog.2022.08.053>) and detailed in Lin and Chu (2022 <doi:10.1371/journal.pone.0268754>).
Authors: Lifeng Lin [aut, cre] , Haitao Chu [aut]
Maintainer: Lifeng Lin <[email protected]>
License: GPL (>= 2)
Version: 1.6
Built: 2024-11-25 15:05:58 UTC
Source: CRAN

Help Index


Randomized Controlled Trials of Antidepressant Drugs

Description

An illustrative example of clinical studies with binary outcomes.

Usage

data("dat.ad")

Format

A data frame with 347 randomized controlled trials of antidepressant drugs, which contains the following 4 variables.

e0

a numeric vector indicating event counts in treatment group 0.

n0

a numeric vector indicating sample sizes in treatment group 0.

e1

a numeric vector indicating event counts in treatment group 1.

n1

a numeric vector indicating sample sizes in treatment group 1.

Details

The binary outcome is acceptability (dropout due to any cause). The 347 trials are selected from Cipriani et al. (2018) after excluding trials with missing data or with more than two treatment arms.

Source

Cipriani A, Furukawa TA, Salanti G, Chaimani A, Atkinson LZ, Ogawa Y, Leucht S, Ruhe HG, Turner EH, Higgins JPT, Egger M, Takeshima N, Hayasaka Y, Imai H, Shinohara K, Tajika A, Ioannidis JPA, Geddes JR (2018). "Comparative efficacy and acceptability of 21 antidepressant drugs for the acute treatment of adults with major depressive disorder: a systematic review and network meta-analysis." Lancet, 391(10128), 1357–66. <doi:10.1016/S0140-6736(17)32802-7>


Network Meta-Analysis of Chronic Obstructive Pulmonary Disease

Description

An illustrative example of network meta-analysis with a binary outcome.

Usage

data("dat.copd")

Format

A data frame with 3 studies and 4 treatments, with the following 4 variables.

sid

a numeric vector indicating study IDs.

tid

a numeric vector indicating treatment IDs.

e

a numeric vector indicating event counts.

n

a numeric vector indicating sample sizes.

Details

The dataset was reported in Table 1 of Woods et al. (2010), and was also used as an illustrative example in the netmeta. It investigates the effects of four treatments on chronic obstructive pulmonary disease (COPD), including 1) placebo; 2) fluticasone; 3) salmeterol; and 4) salmeterol fluticasone combination (SFC). Of note, Woods et al. (2010) originally used this dataset to illustrate the usage of network meta-analysis of count and hazard ratio statistics; this package focuses solely on the event counts to show the relevant functions' usage for binary outcomes.

Source

Woods BS, Hawkins N, Scott DA (2010). "Network meta-analysis on the log-hazard scale, combining count and hazard ratio statistics accounting for multi-arm trials: a tutorial." BMC Medical Research Methodology, 10, 54. <doi:10.1186/1471-2288-10-54>


Meta-analyses on Nutrition Support

Description

An illustrative example of meta-analyses with binary outcomes.

Usage

data("dat.ns")

Format

A data frame with 564 meta-analyses on nutrition support, which contains the following 5 variables.

ma.id

a numeric vector indicating meta-analysis indexes.

e0

a numeric vector indicating event counts in treatment group 0.

n0

a numeric vector indicating sample sizes in treatment group 0.

e1

a numeric vector indicating event counts in treatment group 1.

n1

a numeric vector indicating sample sizes in treatment group 1.

Details

The meta-analyses are extracted from Feinberg et al. (2017) after excluding meta-analyses with non-binary outcomes. The selected 564 meta-analyses focus on different binary outcomes.

Source

Feinberg J, Nielsen EE, Korang SK, Halberg Engell K, Nielsen MS, Zhang K, Didriksen M, Lund L, Lindahl N, Hallum S, Liang N, Xiong W, Yang X, Brunsgaard P, Garioud A, Safi S, Lindschou J, Kondrup J, Gluud C, Jakobsen JC (2017). "Nutrition support in hospitalised adults at nutritional risk." Cochrane Database of Systematic Reviews, 5, Art. No.: CD011598. <doi:10.1002/14651858.CD011598.pub2>


Network Meta-Analysis of Smoking Cessation

Description

An illustrative example of network meta-analysis with a binary outcome.

Usage

data("dat.sc")

Format

A data frame containing 24 studies and 4 treatments, with the following 4 variables.

sid

a numeric vector indicating study IDs.

tid

a numeric vector indicating treatment IDs.

e

a numeric vector indicating event counts.

n

a numeric vector indicating sample sizes.

Details

The dataset was originally reported by Hasselblad (1998) and reanalyzed by Lu and Ades (2006) using formal network meta-analysis methods. It investigates the effects of four treatments on smoking cessation, including 1) no contact; 2) self-help; 3) individual counseling; and 4) group counseling. The outcome is binary, which is the smoking cessation status (yes or no) of a participant after treatment.

Source

Hasselblad V (1998). "Meta-analysis of multitreatment studies." Medical Decision Making, 18(1), 37–43. <doi:10.1177/0272989X9801800110>

Lu G, Ades AE (2006). "Assessing evidence inconsistency in mixed treatment comparisons." Journal of the American Statistical Association, 101(474), 447–59. <doi:10.1198/016214505000001302>


Assessing Fragility of a Meta-Analysis With a Binary Outcome

Description

Produces results, such as fragility index, fragility quotient, and event status modifications for altering statistical significance, of a meta-analysis with a binary outcome.

Usage

frag.ma(e0, n0, e1, n1, data, measure = "OR", alpha = 0.05,
        mod.dir = "both", OR = 1, RR = 1, RD = 0,
        method = "DL", test = "z", drop00 = FALSE, ...)

Arguments

e0

a numeric vector or the corresponding column name in the argument data, indicating event counts in group 0 among the studies in the meta-analysis.

n0

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in group 0 among the studies in the meta-analysis.

e1

a numeric vector or the corresponding column name in the argument data, indicating event counts in group 1 among the studies in the meta-analysis.

n1

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in group 1 among the studies in the meta-analysis.

data

an optional data frame containing the dataset of the collected studies in the meta-analysis with a binary outcome. If data is specified, the previous arguments, e0, n0, e1, and n1, should be specified as their corresponding column names in data.

measure

a character string indicating the measure of treatment effect (i.e., effect size) for the binary outcome. It should be one of "OR" (odds ratio, the default), "RR" (relative risk), and "RD" (risk difference).

alpha

a numeric value between 0 and 1, indicating the statistical significance level (the default is 0.05). It determines the confidence level (1α)×100%(1-\alpha)\times100\% of the confidence interval when deriving the fragility index/quotient.

mod.dir

a character string indicating the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance). It is not used when significance is altered to non-significance. It should be one of "left" (moving to the left side of the null value), "right" (moving to the right side of the null value), "one" (based on the direction of the point estimate of the original overall effect size), and "both" (both directions, the default).

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument measure is "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument measure is "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument measure is "RD".

method

a character string specifying the method for performing meta-analysis. It is passed to rma.uni. Options include the fixed-effect model by specifying "FE" and the random-effects model by specifying "DL" (DerSimonian–Laird estimator), "HE" (Hedges estimator), "HS" (Hunter–Schmidt estimator), "SJ" (Sidik–Jonkman estimator), "ML" (maximum likelihood estimator), "REML" (restricted maximum likelihood estimator), "EB" (empirical Bayes estimator), "PM" (Paule–Mandel estimator), or "GENQ" (generalized WW-statistic estimator) for different methods to estimate the heterogeneity variance. See details in the manual of the package metafor.

test

a character string specifying how confidence intervals are derived. It is passed to rma.uni. Options include "z", "t", "knha" (Hartung–Knapp–Sidik–Jonkman method), and "adhoc"; the first indicates Wald-type confidence intervals based on the standard normal distribution (the default), while the latter three yield confidence intervals based on the t-distribution. See details in the manual of the package metafor.

drop00

a logical value indicating whether studies with no events (or only events) in both groups should be dropped when calculating the observed effect sizes or outcomes. It is passed to rma.uni.

...

other arguments that can be passed to rma.uni. See details in the manual of the package metafor.

Value

An object of class "frag.ma". The object is a list containing the following components:

data

original data in the form of a data frame with six columns: event counts, non-event counts, and sample sizes in group 0 and those in group 1 among all studies in the meta-analysis.

measure

measure of treatment effect (i.e., effect size).

alpha

pre-specified statistical significance level.

null

value of odds ratio, relative risk, or risk difference (specified by measure) under the null hypothesis. Note that odds ratio and relative risk are presented on a natural logarithmic scale in all output values.

est.ori

the point estimate of the overall effect size based on the original meta-analysis.

ci.ori

the confidence interval of the overall effect size based on the original meta-analysis.

pval.ori

the p-value of the overall effect size based on the original meta-analysis.

mod.dir

the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance).

FI

fragility index.

FQ

fragility quotient.

dir

direction of the change of statistical significance.

sid.iter

study index(es) with event status modifications during the iterative algorithm.

g0.mod.iter

event status modification(s) in group 0 during the iterative algorithm.

g1.mod.iter

event status modification(s) in group 1 during the iterative algorithm.

est.iter

point estimate(s) of the overall effect size during the iterative algorithm.

ci.iter

confidence interval(s) of the overall effect size during the iterative algorithm.

data.mod

data with event status modification(s) that alter the significance or non-significance.

Note

If the significance or non-significance cannot be altered based on the given range of event status modifications, the fragility index and fragility quotient are defined to be NA (not available).

References

Atal I, Porcher R, Boutron I, Ravaud P (2019). "The statistical significance of meta-analyses is frequently fragile: definition of a fragility index for meta-analyses." Journal of Clinical Epidemiology, 111, 32–40. <doi:10.1016/j.jclinepi.2019.03.012>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

Lin L, Xing A, Chu H, Murad MH, Xu C, Baer BR, Wells MT, Sanchez-Ramos L (2023). "Assessing the robustness of results from clinical trials and meta-analyses with the fragility index." American Journal of Obstetrics and Gynecology, 228(3), 276–282. <doi:10.1016/j.ajog.2022.08.053>

See Also

frag.ma.alpha for assessing fragility of a meta-analysis at multiple significance levels; frag.mas for assessing fragility of multiple meta-analyses; frag.study for assessing fragility of an individual study; and frag.nma for assessing fragility of a network meta-analysis.

Examples

## Load datasets of meta-analyses on nutrition support
data(dat.ns)

## Assess fragility of the 11th meta-analysis
out1 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 11,])
out1

## Visualize the process of event status modifications
##  for altering the non-significance to significance
plot(out1)

## Assess fragility based on relative risk
out2 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 11,],
  measure = "RR")
out2

## Assess fragility based on risk difference
out3 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 11,],
  measure = "RD")
out3

## Use the REML method to estimate the heterogeneity variance
out4 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 11,],
  method = "REML")
out4

## Use the Hartung-Knapp-Sidik-Jonkman to derive
##  the confidence interval in meta-analysis
out5 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 11,],
  method = "REML", test = "knha")
out5

## Change the significance level to 0.005
out6 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 11,],
  alpha = 0.005)
out6
plot(out6)

## Reduce the distance between the two lines by breaking the y-axis
plot(out6, ybreaks = c(5, 9))

## Suppress the markers of study IDs around the lines
plot(out6, ybreaks = c(5, 9), study.marker = FALSE)

## Change the size of markers of study IDs
plot(out6, ybreaks = c(5, 9), cex.marker = 0.5)

## Change the distance between the markers of study IDs and the lines
plot(out6, ybreaks = c(5, 9), offset.marker = 0)

## Change the colors and width of the lines
plot(out6, ybreaks = c(5, 9), col.line = c("gray", "orange"), lwd = 2)

## Change the location of the legend
plot(out6, ybreaks = c(5, 9), x.legend = "topleft")


## Assess fragility of the first meta-analysis;
##  it takes longer time
out7 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 1,])
out7
plot(out7)
plot(out7, ybreaks = c(840, 880))

## Achieve significance by moving the CI based on the direction of the 
##  original overall effect size estimate
out8 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 1,],
  mod.dir = "one")
out8

## Achieve significance by moving the CI to the left side
out9 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 1,],
  mod.dir = "left")
out9

## Achieve significance by moving the CI to the right side;
##  it takes longer time than that moving the CI to the left side
##  as the original overall effect size estimate was less than the null
out10 <- frag.ma(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 1,],
  mod.dir = "right")
out10
dev.new(width = 12, height = 6)
plot(out10, cex.marker = 0.5)

Assessing Fragility of a Meta-Analysis at Different Significance Levels

Description

Produces fragility index or fragility quotient for altering statistical significance of a meta-analysis with a binary outcome at different significance levels.

Usage

frag.ma.alpha(e0, n0, e1, n1, data, measure = "OR",
              alpha.from = 0.005, alpha.to = 0.05, alpha.breaks = 100,
              mod.dir = "both", OR = 1, RR = 1, RD = 0,
              method = "DL", test = "z", drop00 = FALSE, ...)

Arguments

e0

a numeric vector or the corresponding column name in the argument data, indicating event counts in group 0 among the studies in the meta-analysis.

n0

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in group 0 among the studies in the meta-analysis.

e1

a numeric vector or the corresponding column name in the argument data, indicating event counts in group 1 among the studies in the meta-analysis.

n1

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in group 1 among the studies in the meta-analysis.

data

an optional data frame containing the dataset of the collected studies in the meta-analysis with a binary outcome. If data is specified, the previous arguments, e0, n0, e1, and n1, should be specified as their corresponding column names in data.

measure

a character string indicating the measure of treatment effect (i.e., effect size) for the binary outcome. It should be one of "OR" (odds ratio, the default), "RR" (relative risk), and "RD" (risk difference).

alpha.from

a numeric value between 0 and 1, indicating the smallest value of the statistical significance levels to be considered (the default is 0.005). It should be smaller than the argument alpha.to.

alpha.to

a numeric value between 0 and 1, indicating the largest value of the statistical significance levels to be considered (the default is 0.05). It should be larger than the argument alpha.from.

alpha.breaks

a positive integer indicating the number of statistical significance levels to be considered (the default is 100). The candidate significance levels are thus equally-spaced between alpha.from and alpha.to.

mod.dir

a character string indicating the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance). It is not used when significance is altered to non-significance. It should be one of "left" (moving to the left side of the null value), "right" (moving to the right side of the null value), "one" (based on the direction of the point estimate of the original overall effect size), and "both" (both directions, the default).

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument measure is "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument measure is "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument measure is "RD".

method

a character string specifying the method for performing meta-analysis. It is the same with the argument in frag.ma, and is passed to rma.uni. See details in the manual of the package metafor.

test

a character string specifying how confidence intervals are derived. It is the same with the argument in frag.ma, and is passed to rma.uni. See details in the manual of the package metafor.

drop00

a logical value indicating whether studies with no events (or only events) in both groups should be dropped when calculating the observed effect sizes or outcomes. It is passed to rma.uni.

...

other arguments that can be passed to rma.uni. See details in the manual of the package metafor.

Value

An object of classes "frag.alpha" and "frag.ma.alpha". The object is a list containing the following components:

data

original data in the form of a data frame with six columns: event counts, non-event counts, and sample sizes in group 0 and those in group 1 among all studies in the meta-analysis.

measure

measure of treatment effect (i.e., effect size).

alphas

different statistical significance levels.

null

value of odds ratio, relative risk, or risk difference (specified by measure) under the null hypothesis. Note that odds ratio and relative risk are presented on a natural logarithmic scale in all output values.

est.ori

the point estimate of the overall effect size based on the original meta-analysis.

se.ori

the standard error of the overall effect size based on the original meta-analysis.

test

the method used to derive confidence intervals by the function rma.uni. It is one of "z", "t", "knha" (Hartung–Knapp–Sidik–Jonkman method), and "adhoc"; the first indicates Wald-type confidence intervals based on the standard normal distribution, while the latter three yield confidence intervals based on the t-distribution.

pval.ori

the p-value of the overall effect size based on the original meta-analysis.

mod.dir

the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance).

FI

fragility indexes at different statistical significance levels in alphas.

FI.avg

average fragility index.

FQ

fragility quotients at different statistical significance levels in alphas.

FQ.avg

average fragility quotient.

References

Benjamin DJ, Berger JO, Johannesson M, Nosek BA, Wagenmakers EJ, Berk R, Bollen KA, Brembs B, Brown L, Camerer C, Cesarini D, Chambers CD, Clyde M, Cook TD, De Boeck P, Dienes Z, Dreber A, Easwaran K, Efferson C, Fehr E, Fidler F, Field AP, Forster M, George EI, Gonzalez R, Goodman S, Green E, Green DP, Greenwald AG, Hadfield JD, Hedges LV, Held L, Ho TH, Hoijtink H, Hruschka DJ, Imai K, Imbens G, Ioannidis JPA, Jeon M, Jones JH, Kirchler M, Laibson D, List J, Little R, Lupia A, Machery E, Maxwell SE, McCarthy M, Moore DA, Morgan SL, Munafo M, Nakagawa S, Nyhan B, Parker TH, Pericchi L, Perugini M, Rouder J, Rousseau J, Savalei V, Schonbrodt FD, Sellke T, Sinclair B, Tingley D, Van Zandt T, Vazire S, Watts DJ, Winship C, Wolpert RL, Xie Y, Young C, Zinman J, Johnson VE (2018). "Redefine statistical significance." Nature Human Behaviour, 2, 6–10. <doi:10.1038/s41562-017-0189-z>

Ioannidis JPA (2018). "The proposal to lower P value thresholds to .005." JAMA, 319(14), 1429–30. <doi:10.1001/jama.2018.1536>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.ma for assessing fragility of a meta-analysis at a specific significance level; and frag.study.alpha for assessing fragility of an individual study at multiple significance levels

Examples

## Load datasets of meta-analyses on nutrition support
data(dat.ns)

## Assess fragility of the 11th meta-analysis
##  at multiple significance levels
out1 <- frag.ma.alpha(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 11,],
  alpha.from = 0.01, alpha.to = 0.05, alpha.breaks = 5)
out1

## Generate plot to show fragility measures against significance levels;
##  see more options of usage in examples of frag.study.alpha()
plot(out1)
plot(out1, fragility = "FQ")


## Assess fragility of the 6th meta-analysis
##  at multiple significance levels;
##  it takes longer time
out2 <- frag.ma.alpha(e0, n0, e1, n1, data = dat.ns[dat.ns$ma.id == 6,])
out2
plot(out2)

Assessing Fragility of Multiple Meta-Analyses With Binary Outcomes

Description

Produces fragility indexes or fragility quotients for altering statistical significance of multiple meta-analyses with binary outcomes.

Usage

frag.mas(e0, n0, e1, n1, ma.id, data, measure = "OR", alpha = 0.05,
         mod.dir = "both", OR = 1, RR = 1, RD = 0,
         method = "DL", test = "z", drop00 = FALSE, ...)

Arguments

e0

a numeric vector or the corresponding column name in the argument data, indicating event counts in group 0 among the studies in all meta-analyses.

n0

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in group 0 among the studies in all meta-analyses.

e1

a numeric vector or the corresponding column name in the argument data, indicating event counts in group 1 among the studies in all meta-analyses.

n1

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in group 1 among the studies in all meta-analyses.

ma.id

a numeric vector or the corresponding column name in the argument data, indicating the index of each meta-analysis.

data

an optional data frame containing the dataset of the multiple meta-analyses with binary outcomes. If data is specified, the previous arguments, e0, n0, e1, n1, and ma.id, should be specified as their corresponding column names in data.

measure

a character string indicating the measure of treatment effect (i.e., effect size) for the binary outcome. It should be one of "OR" (odds ratio, the default), "RR" (relative risk), and "RD" (risk difference).

alpha

a numeric value between 0 and 1, indicating the statistical significance level (the default is 0.05). It determines the confidence level (1α)×100%(1-\alpha)\times100\% of the confidence interval when deriving the fragility index/quotient.

mod.dir

a character string indicating the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance). It is not used when significance is altered to non-significance. It should be one of "left" (moving to the left side of the null value), "right" (moving to the right side of the null value), "one" (based on the direction of the point estimate of the original overall effect size), and "both" (both directions, the default).

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument measure is "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument measure is "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument measure is "RD".

method

a character string specifying the method for performing meta-analysis. It is the same with the argument in frag.ma, and is passed to rma.uni. See details in the manual of the package metafor.

test

a character string specifying how confidence intervals are derived. It is the same with the argument in frag.ma, and is passed to rma.uni. See details in the manual of the package metafor.

drop00

a logical value indicating whether studies with no events (or only events) in both groups should be dropped when calculating the observed effect sizes or outcomes. It is passed to rma.uni.

...

other arguments that can be passed to rma.uni. See details in the manual of the package metafor.

Value

An object of classes "frag.mas" and "frag.multi". The object is a list containing the following components:

measure

measure of treatment effect (i.e., effect size).

alpha

pre-specified statistical significance level.

null

value of odds ratio, relative risk, or risk difference (specified by measure) under the null hypothesis. Note that odds ratio and relative risk are presented on a natural logarithmic scale in all output values.

mod.dir

the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance).

est.ori

the point estimates of the overall effect sizes based on the original datasets of the multiple meta-analyses.

ci.ori

the confidence intervals of the overall effect sizes based on the original datasets of the multiple meta-analyses.

pval.ori

the p-values of the overall effect sizes based on the original datasets of the multiple meta-analyses.

FI

fragility indexes of the multiple meta-analyses.

FQ

fragility quotients of the multiple meta-analyses.

References

Atal I, Porcher R, Boutron I, Ravaud P (2019). "The statistical significance of meta-analyses is frequently fragile: definition of a fragility index for meta-analyses." Journal of Clinical Epidemiology, 111, 32–40. <doi:10.1016/j.jclinepi.2019.03.012>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.ma for assessing fragility of a meta-analysis; and frag.studies for assessing fragility of multiple individual studies.

Examples

## Load datasets of meta-analyses on nutrition support
data(dat.ns)

## Assess fragility of the 11th, 12th, and 13th meta-analyses
out1 <- frag.mas(e0, n0, e1, n1, ma.id,
  data = dat.ns[dat.ns$ma.id >= 11 & dat.ns$ma.id <= 13,], mod.dir = "one")
out1

## Generate bar plot or histogram to show fragility measures' distribution;
##  see more options of usage in examples of frag.studies()
plot(out1)


## Assess fragility of all meta-analyses
##  in the Cochrane systematic review on nutrition support;
##  it takes longer time
out2 <- frag.mas(e0, n0, e1, n1, ma.id, data = dat.ns)
out2
plot(out2)
plot(out2, max.f = 40, cex.name = 0.6, mgp = c(2, 0.5, 0))
plot(out2, fragility = "FQ", breaks = 20)

Assessing Fragility of a Network Meta-Analysis With a Binary Outcome

Description

Produces results, such as fragility index, fragility quotient, and event status modifications for altering statistical significance, of treatment comparison(s) in a network meta-analysis with a binary outcome.

Usage

frag.nma(sid, tid, e, n, data, measure = "OR", random = TRUE, alpha = 0.05,
         mod.dir = "both", tid1.f, tid2.f, OR = 1, RR = 1, RD = 0,
         incr, allincr, addincr, allstudies, ...)

Arguments

sid

a numeric vector or the corresponding column name in the argument data, indicating the study IDs in the network meta-analysis.

tid

a numeric vector or the corresponding column name in the argument data, indicating the treatment IDs in the network meta-analysis.

e

a numeric vector or the corresponding column name in the argument data, indicating the event count in each study's each treatment group in the network meta-analysis.

n

a numeric vector or the corresponding column name in the argument data, indicating the sample size in each study's each treatment group in the network meta-analysis.

data

an optional data frame containing the dataset of the collected studies on multiple treatment comparisons in the network meta-analysis with a binary outcome. If data is specified, the previous arguments, sid, tid, e, and n, should be specified as their corresponding column names in data.

measure

a character string indicating the measure of treatment effect (i.e., effect size) for the binary outcome. It should be one of "OR" (odds ratio, the default), "RR" (relative risk), and "RD" (risk difference).

random

a logical value indicating whether the network meta-analysis is performed under the fixed-effects setting (FALSE) or the random-effects setting (TRUE, the default).

alpha

a numeric value between 0 and 1, indicating the statistical significance level (the default is 0.05). It determines the confidence level (1α)×100%(1-\alpha)\times100\% of the confidence interval when deriving the fragility index/quotient.

mod.dir

a character string or a square matrix of character strings indicating the direction of the confidence interval change for each treatment comparison due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance). It is not used when significance is altered to non-significance. It should be one of "left" (moving to the left side of the null value), "right" (moving to the right side of the null value), "one" (based on the direction of the point estimate of the original overall effect size), and "both" (both directions, the default). When it is specified as a matrix, the dimension should be the number of treatments, and the element (h, k) specifies the direction for treatment h compared with treatment k.

tid1.f

the first treatment(s) of comparison(s) of interest; if not specified, the fragility of all comparisons will be assessed.

tid2.f

the second treatment(s) of comparison(s) of interest.

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument measure is "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument measure is "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument measure is "RD".

incr

A numerical value which is added to each cell frequency for studies with a zero cell count. It is passed to the function pairwise in the package netmeta.

allincr

A logical value indicating whether incr is added to each cell frequency of all studies if at least one study has a zero cell count. If FALSE (the default), incr is added only to each cell frequency of studies with a zero cell count. It is passed to the function pairwise in the package netmeta.

addincr

A logical value indicating whether incr is added to each cell frequency of all studies irrespective of zero cell counts (the default is FALSE). It is passed to the function pairwise in the package netmeta.

allstudies

A logical value indicating whether studies with zero or all events in two treatment groups are to be included in the network meta-analysis (the default is FALSE). It is used only for measure = "OR" and "RR". It is passed to the function pairwise in the package netmeta.

...

other arguments that can be passed to netmeta. See details in the manual of the package netmeta.

Value

An object of class "frag.nma". The object is a list containing the following components:

data

original data of the network meta-analysis.

measure

measure of treatment effect (i.e., effect size).

alpha

pre-specified statistical significance level.

null

value of odds ratio, relative risk, or risk difference (specified by measure) under the null hypothesis. Note that odds ratio and relative risk are presented on a natural logarithmic scale in all output values.

est.ori

a matrix containing the point estimate of the overall effect size for each pair of treatment comparisons based on the original network meta-analysis. Each element presents the treatment corresponding to the row compared with the treatment corresponding to the column; a similar interpretation applies to other outputs in the form of a matrix.

ci.lb.ori

the lower bound of the confidence interval of the overall effect size for each pair of treatment comparisons based on the original network meta-analysis.

ci.lb.ori

the upper bound of the confidence interval of the overall effect size for each pair of treatment comparisons based on the original network meta-analysis.

pval.ori

the p-value of the overall effect size for each pair of treatment comparisons based on the original network meta-analysis.

mod.dir

the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance).

tid.f

treatment comparisons whose fragility is assessed.

FI

fragility index.

FQ

fragility quotient, calculated as fragility index divided by the total sample size associated with the specific treatment comparison.

FQ.nma

fragility quotient, calculated as fragility index divided by the total sample size in the whole network meta-analysis (across all treatment groups).

dir

direction of the change of statistical significance.

sid.iter

a list of study index(es) with event status modifications during the iterative algorithm for specific pairs of treatment comparisons.

tid1.mod.iter

a list of event status modification(s) in the first treatment group during the iterative algorithm for specific pairs of treatment comparisons.

tid2.mod.iter

a list of event status modification(s) in the second treatment group during the iterative algorithm for specific pairs of treatment comparisons.

est.iter

a list of point estimate(s) of the overall effect size during the iterative algorithm for specific pairs of treatment comparisons.

ci.lb.iter

a list of lower bound(s) of confidence interval(s) of the overall effect size during the iterative algorithm for specific pairs of treatment comparisons.

ci.ub.iter

a list of upper bound(s) of confidence interval(s) of the overall effect size during the iterative algorithm for specific pairs of treatment comparisons.

data.mod

a list of data with event status modification(s) that alter the significance or non-significance for specific pairs of treatment comparisons.

Note

When the network meta-analysis contains many studies and many treatments, the assessment of fragility may be very computationally demanding. In such cases, one may focus on certain treatment comparisons that are of primary interest by specifying the arguments tid1.f and tid2.f. Also, if the significance or non-significance cannot be altered based on the given range of event status modifications, the fragility index and fragility quotient are defined to be NA (not available).

References

Schwarzer G, Carpenter JR, Rucker G (2015). Meta-Analysis with R. Cham, Switzerland: Springer. <doi:10.1007/978-3-319-21416-0>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

Lin L, Xing A, Chu H, Murad MH, Xu C, Baer BR, Wells MT, Sanchez-Ramos L (2023). "Assessing the robustness of results from clinical trials and meta-analyses with the fragility index." American Journal of Obstetrics and Gynecology, 228(3), 276–282. <doi:10.1016/j.ajog.2022.08.053>

Xing A, Chu H, Lin L (2020). "Fragility index of network meta-analysis with application to smoking cessation data." Journal of Clinical Epidemiology, 127, 29–39. <doi:10.1016/j.jclinepi.2020.07.003>

See Also

frag.nma.alpha for assessing fragility of a network meta-analysis at multiple significance levels; frag.study for assessing fragility of an individual study; and frag.ma for assessing fragility of a meta-analysis.

Examples

## Load datasets of network meta-analysis of
##  chronic obstructive pulmonary disease (COPD)
data(dat.copd)

## Assess fragility of network meta-analysis of COPD
out1 <- frag.nma(sid, tid, e, n, data = dat.copd)
out1

## Retrieve the estimated log odds ratio in the original dataset
out1$est.ori
## Retrieve the fragility index of each treatment comparison
out1$FI
## Retrieve the direction of significance change for comparison 2 vs. 3
out1$dir["2", "3"]
## Retrieve the study IDs with iterative event status modifications
##  for comparison 2 vs. 3
out1$sid.iter[["2 vs. 3"]]
## Retrieve the event status modifications
##  in the first group (i.e., treatment 2)
out1$tid1.mod.iter[["2 vs. 3"]]
## Retrieve the event status modifications
##  in the second group (i.e., treatment 3)
out1$tid2.mod.iter[["2 vs. 3"]]

## Visualize the process of event status modifications
##  for altering the non-significance to significance for each comparison;
##  see more options of usage in examples of frag.ma()
plot(out1, tid1 = 2, tid2 = 1)
plot(out1, tid1 = 3, tid2 = 1)
plot(out1, tid1 = 4, tid2 = 1)
plot(out1, tid1 = 3, tid2 = 2)
plot(out1, tid1 = 4, tid2 = 2)
plot(out1, tid1 = 4, tid2 = 3)

## Assess fragility of treatment comparisons 2 vs. 1 and 3 vs. 1 only
out2 <- frag.nma(sid, tid, e, n, data = dat.copd,
  tid1.f = c(2, 3), tid2.f = c(1, 1))
out2

## The default plot presents the process of event status modification
##  for the first comparison, i.e., 2 vs. 1
plot(out2)

## Load datasets of network meta-analysis of smoking cessation
data(dat.sc)

## Assess fragility of network meta-analysis of smoking cessation
out3 <- frag.nma(sid, tid, e, n, data = dat.sc)
out3

## Visualize the process of event status modifications
plot(out3, tid1 = 2, tid2 = 1, ybreaks = c(170, 595),
  x.legend = "topright")
plot(out3, tid1 = 3, tid2 = 1, ybreaks = c(635, 1200),
  x.legend = "bottomright")
plot(out3, tid1 = 4, tid2 = 1, ybreaks = c(105, 600))
plot(out3, tid1 = 3, tid2 = 2, ybreaks = c(160, 1205))
plot(out3, tid1 = 4, tid2 = 2, ybreaks = c(110, 140),
  x.legend = "topright")
plot(out3, tid1 = 4, tid2 = 3, ybreaks = c(130, 1205),
  x.legend = "bottomright")

Assessing Fragility of a Network Meta-Analysis at Different Significance Levels

Description

Produces fragility index or fragility quotient for altering statistical significance of treatment comparison(s) in a network meta-analysis with a binary outcome at different significance levels.

Usage

frag.nma.alpha(sid, tid, e, n, data, measure = "OR", random = TRUE,
               alpha.from = 0.005, alpha.to = 0.05, alpha.breaks = 10,
               mod.dir = "both", tid1.f, tid2.f, OR = 1, RR = 1, RD = 0,
               incr, allincr, addincr, allstudies, ...)

Arguments

sid

a numeric vector or the corresponding column name in the argument data, indicating the study IDs in the network meta-analysis.

tid

a numeric vector or the corresponding column name in the argument data, indicating the treatment IDs in the network meta-analysis.

e

a numeric vector or the corresponding column name in the argument data, indicating the event count in each study's each treatment group in the network meta-analysis.

n

a numeric vector or the corresponding column name in the argument data, indicating the sample size in each study's each treatment group in the network meta-analysis.

data

an optional data frame containing the dataset of the collected studies on multiple treatment comparisons in the network meta-analysis with a binary outcome. If data is specified, the previous arguments, sid, tid, e, and n, should be specified as their corresponding column names in data.

measure

a character string indicating the measure of treatment effect (i.e., effect size) for the binary outcome. It should be one of "OR" (odds ratio, the default), "RR" (relative risk), and "RD" (risk difference).

random

a logical value indicating whether the network meta-analysis is performed under the fixed-effects setting (FALSE) or the random-effects setting (TRUE, the default).

alpha.from

a numeric value between 0 and 1, indicating the smallest value of the statistical significance levels to be considered (the default is 0.005). It should be smaller than the argument alpha.to.

alpha.to

a numeric value between 0 and 1, indicating the largest value of the statistical significance levels to be considered (the default is 0.05). It should be larger than the argument alpha.from.

alpha.breaks

a positive integer indicating the number of statistical significance levels to be considered (the default is 100). The candidate significance levels are thus equally-spaced between alpha.from and alpha.to.

mod.dir

a character string or a square matrix of character strings indicating the direction of the confidence interval change for each treatment comparison due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance). It is not used when significance is altered to non-significance. It should be one of "left" (moving to the left side of the null value), "right" (moving to the right side of the null value), "one" (based on the direction of the point estimate of the original overall effect size), and "both" (both directions, the default). When it is specified as a matrix, the dimension should be the number of treatments, and the element (h, k) specifies the direction for treatment h compared with treatment k.

tid1.f

the first treatment(s) of comparison(s) of interest; if not specified, the fragility of all comparisons will be assessed.

tid2.f

the second treatment(s) of comparison(s) of interest.

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument measure is "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument measure is "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument measure is "RD".

incr

A numerical value which is added to each cell frequency for studies with a zero cell count. It is passed to the function pairwise in the package netmeta.

allincr

A logical value indicating whether incr is added to each cell frequency of all studies if at least one study has a zero cell count. If FALSE (the default), incr is added only to each cell frequency of studies with a zero cell count. It is passed to the function pairwise in the package netmeta.

addincr

A logical value indicating whether incr is added to each cell frequency of all studies irrespective of zero cell counts (the default is FALSE). It is passed to the function pairwise in the package netmeta.

allstudies

A logical value indicating whether studies with zero or all events in two treatment groups are to be included in the network meta-analysis (the default is FALSE). It is used only for measure = "OR" and "RR". It is passed to the function pairwise in the package netmeta.

...

other arguments that can be passed to netmeta. See details in the manual of the package netmeta.

Value

An object of classes "frag.alpha" and "frag.nma.alpha". The object is a list containing the following components:

data

original data of the network meta-analysis.

measure

measure of treatment effect (i.e., effect size).

alphas

different statistical significance levels.

null

value of odds ratio, relative risk, or risk difference (specified by measure) under the null hypothesis. Note that odds ratio and relative risk are presented on a natural logarithmic scale in all output values.

est.ori

a matrix containing the point estimate of the overall effect size for each pair of treatment comparisons based on the original network meta-analysis. Each element presents the treatment corresponding to the row compared with the treatment corresponding to the column; a similar interpretation applies to other outputs in the form of a matrix.

se.ori

a matrix containing the standard error of the overall effect size for each pair of treatment comparisons based on the original network meta-analysis.

pval.ori

the p-value of the overall effect size for each pair of treatment comparisons based on the original network meta-analysis.

mod.dir

the direction of the confidence interval change due to event status modifications when the original confidence interval covers the null value (i.e., non-significance altered to significance).

tid.f

treatment comparisons whose fragility is assessed.

FI

fragility indexes at different statistical significance levels in alphas.

FI.avg

average fragility indexes.

FQ

fragility quotients at different statistical significance levels in alphas, calculated as fragility indexes divided by the total sample sizes associated with the specific treatment comparisons.

FQ.avg

average fragility quotients based on the total sample sizes associated with the specific treatment comparisons.

FQ.nma

fragility quotients at different statistical significance levels in alphas, calculated as fragility indexes divided by the total sample size in the whole network meta-analysis (across all treatment groups).

FQ.nma.avg

average fragility quotients based on the total sample size in the whole network meta-analysis (across all treatment groups).

Note

When the network meta-analysis contains many studies and many treatments, the assessment of fragility may be very computationally demanding. In such cases, one may focus on certain treatment comparisons that are of primary interest by specifying the arguments tid1.f and tid2.f.

References

Benjamin DJ, Berger JO, Johannesson M, Nosek BA, Wagenmakers EJ, Berk R, Bollen KA, Brembs B, Brown L, Camerer C, Cesarini D, Chambers CD, Clyde M, Cook TD, De Boeck P, Dienes Z, Dreber A, Easwaran K, Efferson C, Fehr E, Fidler F, Field AP, Forster M, George EI, Gonzalez R, Goodman S, Green E, Green DP, Greenwald AG, Hadfield JD, Hedges LV, Held L, Ho TH, Hoijtink H, Hruschka DJ, Imai K, Imbens G, Ioannidis JPA, Jeon M, Jones JH, Kirchler M, Laibson D, List J, Little R, Lupia A, Machery E, Maxwell SE, McCarthy M, Moore DA, Morgan SL, Munafo M, Nakagawa S, Nyhan B, Parker TH, Pericchi L, Perugini M, Rouder J, Rousseau J, Savalei V, Schonbrodt FD, Sellke T, Sinclair B, Tingley D, Van Zandt T, Vazire S, Watts DJ, Winship C, Wolpert RL, Xie Y, Young C, Zinman J, Johnson VE (2018). "Redefine statistical significance." Nature Human Behaviour, 2, 6–10. <doi:10.1038/s41562-017-0189-z>

Ioannidis JPA (2018). "The proposal to lower P value thresholds to .005." JAMA, 319(14), 1429–30. <doi:10.1001/jama.2018.1536>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.nma

Examples

## Load datasets of network meta-analysis of
##  chronic obstructive pulmonary disease (COPD)
data(dat.copd)

## Assess fragility of network  meta-analysis of COPD
##  at multiple significance levels
out1 <- frag.nma.alpha(sid, tid, e, n, data = dat.copd)
out1

## Generate plot to show fragility measures against significance levels;
##  see more options of usage in examples of frag.study.alpha()
plot(out1, tid1 = 2, tid2 = 1)
plot(out1, tid1 = 3, tid2 = 1)
plot(out1, tid1 = 4, tid2 = 1)
plot(out1, tid1 = 3, tid2 = 2)
plot(out1, tid1 = 4, tid2 = 2)
plot(out1, tid1 = 4, tid2 = 3)

Assessing Fragility of Multiple Individual Studies With Binary Outcomes

Description

Produces fragility indexes or fragility quotients for altering statistical significance of multiple individual studies with binary outcomes.

Usage

frag.studies(e0, n0, e1, n1, data, methods,
             modify0 = "both", modify1 = "both", alpha = 0.05,
             alternative = "two.sided", OR = 1, RR = 1, RD = 0)

Arguments

e0

a numeric vector or the corresponding column name in the argument data, indicating event counts in multiple studies' group 0.

n0

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in multiple studies' group 0.

e1

a numeric vector or the corresponding column name in the argument data, indicating event counts in multiple studies' group 1.

n1

a numeric vector or the corresponding column name in the argument data, indicating sample sizes in multiple studies' group 1.

data

an optional data frame containing the dataset of multiple individual studies with binary outcomes. If data is specified, the previous arguments, e0, n0, e1, and n1, should be specified as their corresponding column names in data.

methods

a character string or a vector of character strings indicating the method(s) used to calculate the p-value(s) of the association between treatment and outcome. It must consist of "Fisher" (Fisher's exact test), "chisq" (chi-squared test), "OR" (odds ratio), "RR" (relative risk), and/or "RD" (risk difference). The default is the vector consisting of all aforementioned five methods.

modify0

a character string indicating the event status modifications in group 0. It should be one of "increase" (increasing event numbers), "decrease" (decreasing event numbers), "both" (the default, modifying event numbers in both directions), and "none" (no modification).

modify1

a character string indicating the event status modifications in group 1. It has the same usage with modify0, with the default being "both".

alpha

a numeric value between 0 and 1, indicating the statistical significance level (the default is 0.05).

alternative

a character string of either "two.sided" (the default) or "one.sided", indicating the alternative hypothesis. It is only used for "OR", "RR", and "RD" in the argument methods.

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument methods includes "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument methods includes "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument methods includes "RD".

Value

An object of classes "frag.multi" and "frag.studies". The object is a list containing the following components:

methods

methods used to calculate the p-value(s) of the association between treatment and outcome.

alpha

pre-specified statistical significance level.

alternative

alternative hypothesis.

null

values of odds ratio, relative risk, and risk difference under the null hypothesis; they are only used if "OR", "RR", and "RD" are included in the argument methods, respectively.

modify0

type of event status modifications in group 0.

modify1

type of event status modifications in group 1.

pval

p-value(s) produced by the method(s) included in the argument methods for each study.

FI

fragility indexes based on the method(s) among all studies.

FQ

fragility quotients based on the method(s) among all studies.

Of note, if both arguments modify0 and modify0 are "none" (i.e., no modification), the items FI and FQ in the above list are not produced, because fragility cannot be assessed without event status modifications.

References

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

Walsh M, Srinathan SK, McAuley DF, Mrkobrada M, Levine O, Ribic C, Molnar AO, Dattani ND, Burke A, Guyatt G, Thabane L, Walter SD, Pogue J, Devereaux PJ (2014). "The statistical significance of randomized controlled trial results is frequently fragile: a case for a Fragility Index." Journal of Clinical Epidemiology, 67(6), 622–8. <doi:10.1016/j.jclinepi.2013.10.019>

See Also

frag.study for assessing fragility of an individual study.

Examples

## Load datasets of trials on antidepressant drugs
data(dat.ad)

## Assess fragility of first 50 trials on antidepressant drugs
out1 <- frag.studies(e0, n0, e1, n1, data = dat.ad[1:50,], methods = "OR")
out1

## Visualize the results using the bar plot of fragility indexes
plot(out1)

## Additional arguments that can be passed to barplot()
plot(out1, cex.name = 0.7, mgp = c(2, 0.5, 0),
  main = "Bar plot of fragility index")

## Reverse the bars that represent two directions of significance change
plot(out1, reverse = TRUE)

## Add space between bars, suppress borders, and change colors of bars
plot(out1, space = 0.5, col.border = NA, col.sig = c("blue", "red"),
  cex.name = 0.7, mgp = c(2, 0.5, 0))
## More options, such as legends, can be added to the plot
legend("topright", fill = c("blue", "red"), border = NA,
  legend = c("Non-significance altered to significance",
  "Significance altered to non-significance"))

## Visualize the results using the histogram of fragility indexes
plot(out1, bar = FALSE)

## Present density, instead of frequencies (counts), in the histogram
plot(out1, bar = FALSE, freq = FALSE)

## Visualize the results using the histogram of fragility quotients
plot(out1, fragility = "FQ")


## Assess fragility of the complete datasets of 347 trials;
##  it takes longer time
out2 <- frag.studies(e0, n0, e1, n1, data = dat.ad)
out2

## Generate the bar plot for each method
plot(out2, method = "Fisher", cex.name = 0.7, mgp = c(2, 0.5, 0),
  ylim = c(0, 60), main = "Fisher's exact Test")
plot(out2, method = "chisq", cex.name = 0.7, mgp = c(2, 0.5, 0),
  ylim = c(0, 60), main = "Chi-squared test")
plot(out2, method = "OR", cex.name = 0.7, mgp = c(2, 0.5, 0),
  ylim = c(0, 60), main = "Odds ratio")
plot(out2, method = "RR", cex.name = 0.7, mgp = c(2, 0.5, 0),
  ylim = c(0, 60), main = "Relative risk")
plot(out2, method = "RD", cex.name = 0.7, mgp = c(2, 0.5, 0),
  ylim = c(0, 60), main = "Risk difference")

## Restrict the bar plot to studies with
##  significance altered to non-significance
plot(out2, dir = "sig2nonsig", method = "Fisher", cex.name = 0.7,
  mgp = c(2, 0.5, 0), main = "Fisher's exact Test")

## Restrict the bar plot to studies with
##  non-significance altered to significance
plot(out2, dir = "nonsig2sig", method = "Fisher", cex.name = 0.7,
  mgp = c(2, 0.5, 0), main = "Fisher's exact Test")

## Truncate the fragility index at 16
plot(out2, method = "Fisher", max.f = 16, cex.name = 0.7,
  mgp = c(2, 0.5, 0))

## A marker for the truncation will be presented in the histogram
plot(out2, method = "Fisher", bar = FALSE, max.f = 16,
  mgp = c(2, 0.5, 0))

## Visualize the fragility quotients of all trials
plot(out2, method = "Fisher", fragility = "FQ", max.f = 16,
  mgp = c(2, 0.5, 0))

## Use more breaks in the histogram
plot(out2, method = "Fisher", fragility = "FQ", max.f = 16,
  breaks = 20, mgp = c(2, 0.5, 0))

Assessing Fragility of an Individual Study With a Binary Outcome

Description

Produces results, such as fragility index, fragility quotient, and event status modifications for altering statistical significance, of an individual study with a binary outcome.

Usage

frag.study(e0, n0, e1, n1, data, all = FALSE, methods,
           modify0 = "both", modify1 = "both", alpha = 0.05,
           alternative = "two.sided", OR = 1, RR = 1, RD = 0,
           allcase = TRUE)

Arguments

e0

a numeric value or the corresponding column name in the argument data, indicating event count in group 0.

n0

a numeric value or the corresponding column name in the argument data, indicating sample size in group 0.

e1

a numeric value or the corresponding column name in the argument data, indicating event count in group 1.

n1

a numeric value or the corresponding column name in the argument data, indicating sample size in group 1.

data

an optional data frame containing the dataset of the individual study with a binary outcome. If data is specified, the previous arguments, e0, n0, e1, and n1, should be specified as their corresponding column names in data.

all

a logical value indicating whether all eligible event status modifications will be considered (the default is FALSE).

methods

a character string or a vector of character strings indicating the method(s) used to calculate the p-value(s) of the association between treatment and outcome. It must consist of "Fisher" (Fisher's exact test), "chisq" (chi-squared test), "OR" (odds ratio), "RR" (relative risk), and/or "RD" (risk difference). The default is the vector consisting of all aforementioned five methods.

modify0

a character string indicating the event status modifications in group 0. It should be one of "increase" (increasing event numbers), "decrease" (decreasing event numbers), "both" (the default, modifying event numbers in both directions), and "none" (no modification).

modify1

a character string indicating the event status modifications in group 1. It has the same usage with modify0, with the default being "both".

alpha

a numeric value between 0 and 1, indicating the statistical significance level (the default is 0.05).

alternative

a character string of either "two.sided" (the default) or "one.sided", indicating the alternative hypothesis. It is only used for "OR", "RR", and "RD" in the argument methods.

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument methods includes "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument methods includes "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument methods includes "RD".

allcase

a logical value indicating whether obtaining all cases of minimal event status modifications for altering statistical significance or non-significance (the default is TRUE).

Value

An object of class "frag.study" (if the argument all = FALSE) or of both classes "frag.study" and "frag.study.all" (all = TRUE). The object is a list containing the following components:

data

original data in the form of 2×\times2 table.

methods

methods used to calculate the p-value(s) of the association between treatment and outcome.

alpha

pre-specified statistical significance level.

alternative

alternative hypothesis.

null

values of odds ratio, relative risk, and risk difference under the null hypothesis; they are only used if "OR", "RR", and "RD" are included in the argument methods, respectively.

modify0

type of event status modifications in group 0.

modify1

type of event status modifications in group 1.

f0.range

range of event status modifications in group 0.

f1.range

range of event status modifications in group 1.

allcase

a logical value indicating whether all cases of minimal event status modifications for altering statistical significance are obtained; it is only included in the object of class "frag.study".

tot.mods

a matrix containing all possible event status modifications with rows representing modifications in group 0 and columns representing those in group 1; it is determined by f0.range and f1.range, and is only included in the object of class "frag.study.all".

pval

p-value(s) produced by the method(s) included in the argument methods.

FI

fragility index(es) based on the method(s).

FQ

fragility quotient(s) based on the method(s).

dir

direction of the change of statistical significance.

mods

minimal event status modification(s) that alter statistical significance or non-significance.

pvals

p-values based on all possible event status modifications (as in tot.mods); it is only included in the object of class "frag.study.all".

FI0

fragility index(es) based on the method(s) when event status modifications are restricted to group 0; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

FQ0

fragility quotient(s) based on the method(s) when event status modifications are restricted to group 0; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

dir0

direction of the change of statistical significance when event status modifications are restricted to group 0; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

mods0

minimal event status modification(s) that alter statistical significance or non-significance when event status modifications are restricted to group 0; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

FI1

fragility index(es) based on the method(s) when event status modifications are restricted to group 1; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

FQ1

fragility quotient(s) based on the method(s) when event status modifications are restricted to group 1; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

dir1

direction of the change of statistical significance when event status modifications are restricted to group 1; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

mods1

minimal event status modification(s) that alter statistical significance or non-significance when event status modifications are restricted to group 1; it is only included in the object of class "frag.study.all" if both arguments modify0 and modify1 are not "none".

Of note, if both arguments modify0 and modify0 are "none" (i.e., no modification), the items following pval in the above list are not produced, because fragility cannot be assessed without event status modifications.

Note

If the significance or non-significance cannot be altered based on the given range of event status modifications, the fragility index and fragility quotient are defined to be NA (not available).

References

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

Lin L, Xing A, Chu H, Murad MH, Xu C, Baer BR, Wells MT, Sanchez-Ramos L (2023). "Assessing the robustness of results from clinical trials and meta-analyses with the fragility index." American Journal of Obstetrics and Gynecology, 228(3), 276–282. <doi:10.1016/j.ajog.2022.08.053>

Walsh M, Srinathan SK, McAuley DF, Mrkobrada M, Levine O, Ribic C, Molnar AO, Dattani ND, Burke A, Guyatt G, Thabane L, Walter SD, Pogue J, Devereaux PJ (2014). "The statistical significance of randomized controlled trial results is frequently fragile: a case for a Fragility Index." Journal of Clinical Epidemiology, 67(6), 622–8. <doi:10.1016/j.jclinepi.2013.10.019>

See Also

frag.study.alpha for assessing fragility of an individual study at multiple significance levels; frag.studies for assessing fragility of multiple studies; frag.ma for assessing fragility of a meta-analysis; and frag.nma for assessing fragility of a network meta-analysis.

Examples

## Load datasets of trials on antidepressant drugs
data(dat.ad)

## Assess fragility of trial 13
out1 <- frag.study(e0 = e0, n0 = n0, e1 = e1, n1 = n1, data = dat.ad[13,])
out1

## Consider all possible event status modifications
##  and focus on odds ratio
out2 <- frag.study(e0 = e0, n0 = n0, e1 = e1, n1 = n1, data = dat.ad[13,],
  all = TRUE, methods = "OR")
out2

## Visualize the fragility

plot(out2)


## Restrict the modifications to treatment group 0
plot(out2, modify1 = FALSE)

## Change the truncation threshold of p-value to 10^-30
plot(out2, modify1 = FALSE, trun = 30)

## Restrict the modifications to treatment group 1
plot(out2, modify0 = FALSE)

## Assess fragility of trial 13
##  by only increasing event counts in treatment group 0
out3 <- frag.study(e0 = e0, n0 = n0, e1 = e1, n1 = n1, data = dat.ad[13,],
  all = TRUE, modify0 = "increase", modify1 = "none")
out3

## The default plot is for the first method (i.e., Fisher's exact test)
##  if the argument method is not specified
plot(out3)

## Generate plots based on other methods
plot(out3, method = "chisq")
plot(out3, method = "OR")
plot(out3, method = "RR")
plot(out3, method = "RD")

## Assess fragility of trial 13
##  by only modifying event status in treatment group 1
out4 <- frag.study(e0 = e0, n0 = n0, e1 = e1, n1 = n1, data = dat.ad[13,],
  all = TRUE, modify0 = "none", modify1 = "both")
out4
plot(out4)

## Change background colors in the plot
plot(out4, col.sig = c(adjustcolor("blue", alpha.f = 0.1),
  adjustcolor("green", alpha.f = 0.1)))
## Adjust the plot by specifying additional arguments of plot.default()
plot(out4, mgp = c(2, 1, 0), main = "Trial 13", font.main = 1)

## An example of non-significance altered to significance
out5 <- frag.study(e0 = e0, n0 = n0, e1 = e1, n1 = n1, data = dat.ad[21,],
  all = TRUE)
out5
plot(out5, method = "Fisher", legend.pvals = 0.001,
  main = paste("Fragility index =", out5$FI["Fisher"], "in trial 21"))

## Change the statistical significance level to 0.005
out6 <- frag.study(e0 = e0, n0 = n0, e1 = e1, n1 = n1, data = dat.ad[21,],
  all = TRUE, alpha = 0.005)
out6
plot(out6)

## Change the null value of odds ratio to 2
out7 <- frag.study(e0 = e0, n0 = n0, e1 = e1, n1 = n1, data = dat.ad[21,],
  all = TRUE, methods = c("OR"), alpha = 0.05, OR = 2)
out7
plot(out7)

Assessing Fragility of an Individual Study at Different Significance Levels

Description

Produces fragility index or fragility quotient for altering statistical significance of an individual study with a binary outcome at different significance levels.

Usage

frag.study.alpha(e0, n0, e1, n1, data, methods,
                 modify0 = "both", modify1 = "both",
                 alpha.from = 0.005, alpha.to = 0.05, alpha.breaks = 100,
                 alternative = "two.sided", OR = 1, RR = 1, RD = 0)

Arguments

e0

a numeric value or the corresponding column name in the argument data, indicating event count in group 0.

n0

a numeric value or the corresponding column name in the argument data, indicating sample size in group 0.

e1

a numeric value or the corresponding column name in the argument data, indicating event count in group 1.

n1

a numeric value or the corresponding column name in the argument data, indicating sample size in group 1.

data

an optional data frame containing the dataset of the individual study with a binary outcome. If data is specified, the previous arguments, e0, n0, e1, and n1, should be specified as their corresponding column names in data.

methods

a character string or a vector of character strings indicating the method(s) used to calculate the p-value(s) of the association between treatment and outcome. It must consist of "Fisher" (Fisher's exact test), "chisq" (chi-squared test), "OR" (odds ratio), "RR" (relative risk), and/or "RD" (risk difference). The default is the vector consisting of all aforementioned five methods.

modify0

a character string indicating the event status modifications in group 0. It should be one of "increase" (increasing event numbers), "decrease" (decreasing event numbers), "both" (the default, modifying event numbers in both directions), and "none" (no modification).

modify1

a character string indicating the event status modifications in group 1. It has the same usage with modify0, with the default being "both".

alpha.from

a numeric value between 0 and 1, indicating the smallest value of the statistical significance levels to be considered (the default is 0.005). It should be smaller than the argument alpha.to.

alpha.to

a numeric value between 0 and 1, indicating the largest value of the statistical significance levels to be considered (the default is 0.05). It should be larger than the argument alpha.from.

alpha.breaks

a positive integer indicating the number of statistical significance levels to be considered (the default is 100). The candidate significance levels are thus equally-spaced between alpha.from and alpha.to.

alternative

a character string of either "two.sided" (the default) or "one.sided", indicating the alternative hypothesis. It is only used for "OR", "RR", and "RD" in the argument methods.

OR

a numeric positive value indicating the value of odds ratio under the null hypothesis (the default is 1). It is used only if the argument methods includes "OR".

RR

a numeric positive value indicating the value of relative risk under the null hypothesis (the default is 1). It is used only if the argument methods includes "RR".

RD

a numeric value between -1 indicating the value of risk difference under the null hypothesis (the default is 0). It is used only if the argument methods includes "RD".

Value

An object of classes "frag.alpha" and "frag.study.alpha". The object is a list containing the following components:

data

original data in the form of 2×\times2 table.

methods

methods used to calculate the p-value(s) of the association between treatment and outcome.

alphas

different statistical significance levels.

alternative

alternative hypothesis.

null

values of odds ratio, relative risk, and risk difference under the null hypothesis; they are only used if "OR", "RR", and "RD" are included in the argument methods, respectively.

modify0

type of event status modifications in group 0.

modify1

type of event status modifications in group 1.

f0.range

range of event status modifications in group 0.

f1.range

range of event status modifications in group 0.

pval

p-value(s) produced by the method(s) included in the argument methods.

FI

fragility indexes based on the method(s) at each statistical significance level in alphas.

FI.avg

average fragility index based on each method.

FQ

fragility quotients based on the method(s) at each statistical significance level in alphas.

FQ.avg

average fragility quotient based on each method.

Of note, if both arguments modify0 and modify0 are "none" (i.e., no modification), the items following pval in the above list are not produced, because fragility cannot be assessed without event status modifications.

References

Benjamin DJ, Berger JO, Johannesson M, Nosek BA, Wagenmakers EJ, Berk R, Bollen KA, Brembs B, Brown L, Camerer C, Cesarini D, Chambers CD, Clyde M, Cook TD, De Boeck P, Dienes Z, Dreber A, Easwaran K, Efferson C, Fehr E, Fidler F, Field AP, Forster M, George EI, Gonzalez R, Goodman S, Green E, Green DP, Greenwald AG, Hadfield JD, Hedges LV, Held L, Ho TH, Hoijtink H, Hruschka DJ, Imai K, Imbens G, Ioannidis JPA, Jeon M, Jones JH, Kirchler M, Laibson D, List J, Little R, Lupia A, Machery E, Maxwell SE, McCarthy M, Moore DA, Morgan SL, Munafo M, Nakagawa S, Nyhan B, Parker TH, Pericchi L, Perugini M, Rouder J, Rousseau J, Savalei V, Schonbrodt FD, Sellke T, Sinclair B, Tingley D, Van Zandt T, Vazire S, Watts DJ, Winship C, Wolpert RL, Xie Y, Young C, Zinman J, Johnson VE (2018). "Redefine statistical significance." Nature Human Behaviour, 2, 6–10. <doi:10.1038/s41562-017-0189-z>

Ioannidis JPA (2018). "The proposal to lower P value thresholds to .005." JAMA, 319(14), 1429–30. <doi:10.1001/jama.2018.1536>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.study for assessing fragility of an individual study at a specific significance level.

Examples

## Load datasets of trials on antidepressant drugs
data(dat.ad)

## Assess fragility of trial 13 at multiple significance levels
out1 <- frag.study.alpha(e0, n0, e1, n1, data = dat.ad[13,])
out1

## Generate plots to show the change of fragility measure,
##  where the default plot is for the first method
##  (i.e., Fisher's exact test) if the argument method is not specified
plot(out1)

## The plot for odds ratio
plot(out1, method = "OR")

## Change the choices of significance levels
out2 <- frag.study.alpha(e0, n0, e1, n1, data = dat.ad[13,],
  methods = "OR", alpha.from = 0.001, alpha.to = 0.1, alpha.breaks = 500)
out2
plot(out2)

## Generate the plot with the x-axis on the log scale
plot(out2, log = "x")

## Generate the plot for fragility quotient (in percentage)
plot(out2, fragility = "FQ", log = "x")

## Generate the plot for fragility quotient (in decimal form)
plot(out2, fragility = "FQ", percentage = FALSE, log = "x")

## Change the size of points
plot(out2, cex.pts = 1, log = "x")

## Change the colors
plot(out2, col.line = "blue", col.pval = "orange",
  col.sig = c("gray", "black"), log = "x")

## Change the line type
plot(out2, lty.pval = 3, log = "x")

## Change the line width
plot(out2, lwd = 2, lwd.pval = 2, log = "x")

## Change the point symbol
plot(out2, pch = 1, log = "x")

Plot Method for "frag.alpha" Objects

Description

Visualizes the fragility at different statistical significance levels.

Usage

## S3 method for class 'frag.alpha'
plot(x, method, fragility = "FI", percentage = TRUE,
     xlab, ylab, xlim, ylim, cex.pts, col.line, col.pval, col.sig,
     lty.pval, lwd, lwd.pval, pch, pch.na, tid1, tid2, FQ.nma = FALSE, ...)

Arguments

x

an object of class "frag.alpha" produced by the function frag.study.alpha, frag.ma.alpha, or frag.nma.alpha.

method

a character string indicating the method used to calculate the p-value when x is of class "frag.study.alpha" produced by frag.study.alpha. It must be an element of x$methods; the default is the first method in x$methods.

fragility

a character string of either "FI" (fragility index, the default) or "FQ" (fragility quotient), indicating which fragility measure will be presented in the plot.

percentage

a logical value indicating whether the fragility quotient is presented in percentage (TRUE, the default) or not (FALSE). It is only used when the argument fragility = "FQ".

xlab

a label for the x axis.

ylab

a label for the y axis.

xlim

the x limits c(x1, x2) of the plot.

ylim

the y limits c(y1, y2) of the plot.

cex.pts

the size of points in the plot (the default is 0.5).

col.line

the color of the line segments that join the points (the default is "gray50").

col.pval

the color of the vertical line depicting the p-value of the original data (the default is "gray50"). It is only used when the p-value is between the lower and upper limits of the considered significance levels.

col.sig

a vector of the two colors for two directions of significance change. The default includes "forestgreen" (for non-significance altered to significance) and "firebrick" (for significance altered to non-significance).

lty.pval

the type of the vertical line depicting the p-value of the original data. The default is 2 (dashed). It is only used when the p-value is between the lower and upper limits of the considered significance levels.

lwd

the width of the line segments that join the points (the default is 1).

lwd.pval

the width of the vertical line depicting the p-value of the original data. The default is 1. It is only used when the p-value is between the lower and upper limits of the considered significance levels.

pch

the symbol of points in the plot. The default is 16 (filled circle).

pch.na

the symbol of points depicting fragility index/quotient = NA (if any, in cases that significance or non-significance cannot be altered). The default is 1 (unfilled circle).

tid1

the first treatment of the comparison of interest; if not specified, the first comparison in x$tid.f will be used. It is only used when x is of class "frag.nma.alpha" for a network meta-analysis.

tid2

the second treatment of the comparison of interest. Only one comparison can be specified by tid1 and tid2 at one time for plotting. It is only used when x is of class "frag.nma.alpha".

FQ.nma

a logical value indicating whether the fragility quotient in a network meta-analysis is the total sample size associated with the specific treatment comparison (FALSE, the default) or the total sample size in the whole network meta-analysis across all treatment groups (TRUE). It is only used when x is of class "frag.nma.alpha".

...

other arguments that can be passed to plot.default.

Details

A scatter plot is generated, where the x axis presents the different significance levels, and the y axis presents the corresponding fragility indexes or fragility quotients.

Value

None.

References

Lin L (2021). "Factors that impact fragility index and their visualizations." Journal of Evaluation in Clinical Practice, 27(2), 356–64. <doi:10.1111/jep.13428>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.study.alpha, frag.ma.alpha, and frag.nma.alpha for assessing fragility of an individual study, a meta-analysis, and a network meta-analysis at multiple significance levels, respectively.


Plot Method for "frag.ma" Objects

Description

Visualizes the iterative process of event status modifications for deriving the fragility index/quotient of a meta-analysis with a binary outcome.

Usage

## S3 method for class 'frag.ma'
plot(x, xlab, ylab, xlim, ylim, ybreaks = NULL,
     study.marker = TRUE, cex.marker, offset.marker, col.line, lwd,
     legend, x.legend, y.legend, cex.legend, ...)

Arguments

x

an object of class "frag.ma" produced by the function frag.ma.

xlab

a label for the x axis.

ylab

a label for the y axis.

xlim

the x limits c(x1, x2) of the plot.

ylim

the y limits c(y1, y2) of the plot.

ybreaks

a vector of the two numeric values for breaking the y axis or NULL (the default, not breaking the y axis). The two values should be between the total event counts in groups 0 and 1, and the first value should be less than the second value. It is useful when the total event counts in the two groups differ a lot, leading to a large distance between the two lines representing the event status modifications in the two groups.

study.marker

a logical value indicating whether study labels involved in event status modifications are presented in the plot (the default is TRUE). When using the default, an asterisk represents that the study with an event status modification remains the same as in the previous iteration.

cex.marker

the size of study labels (when study.marker = TRUE) with the default 0.8.

offset.marker

a numeric value controlling the distance between study labels from the lines (the default is 0.2). It is passed to the function text.

col.line

a vector of the two colors for two lines representing the event status modifications in groups 0 and 1. The default includes "blue" (for group 0) and "red" (for group 1).

lwd

the width of the lines (the default is 1).

legend

the legend of plot. The default gives the two groups.

x.legend

the x co-ordinate or a keyword, such as "right" (the default), to be used to position the legend. It is passed to legend.

y.legend

the y co-ordinate to be used to position the legend (the default is NULL).

cex.legend

the size of legend text (the default is 1).

...

other arguments that can be passed to plot.default.

Details

A plot showing the iterative process of event status modifications is generated. The x axis presents the iterations, and the y axis gives the group-specific total event counts.

Value

None.

References

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.ma


Plot Method for "frag.multi" Objects

Description

Visualizes the fragility of multiple studies or multiple meta-analyses with binary outcomes.

Usage

## S3 method for class 'frag.multi'
plot(x, method, dir = "both", fragility = "FI", percentage = TRUE,
     max.f = NULL, bar, names.arg, space = 0, breaks, freq, reverse = FALSE,
     xlab, ylab, main = NULL, cex.marker, col.border, col.sig,
     trun.marker = TRUE, ...)

Arguments

x

an object of class "frag.multi" produced by the function frag.studies or frag.mas.

method

a character string indicating the method used to calculate the p-value when x is of class "frag.studies" produced by frag.studies. It must be an element of x$methods; the default is the first method in x$methods.

dir

a character string indicating the type of fragility measures to be considered in the plot with a certain direction of the significance change. It can be one of "sig2nonsig" (significance altered to non-significance), "nonsig2sig" (non-significance altered to significance), and "both" (both directions, the default).

fragility

a character string of either "FI" (fragility index, the default) or "FQ" (fragility quotient), indicating which fragility measure will be presented in the plot.

percentage

a logical value indicating whether the fragility quotient is presented in percentage (TRUE, the default) or not (FALSE). It is only used when the argument fragility = "FQ".

max.f

a positive numeric value indicating the maximum fragility index/quotient to be presented in the plot. Fragility indexes/quotients larger than max.f (if any) will be truncated. The default is NULL (i.e., no truncation).

bar

a logical value indicating whether a bar plot (TRUE) or a histogram (FALSE) will be generated. The bar plot is only available for fragility index (the argument fragility = "FI"); the default is bar = TRUE in this case. For fragility quotient (fragility = "FQ"), bar is always set to FALSE.

names.arg

a vector of names to be plotted below each bar. It is only used in the bar plot (bar = TRUE) for fragility index (fragility = "FI"). The default includes values increasing from the minimum fragility index to the maximum fragility index (or max.f) by 1.

space

the amount of space (as a fraction of the average bar width) left before each bar. The default is 0. It is only used in the bar plot (bar = TRUE) for fragility index (fragility = "FI").

breaks

the breaks on the x axis in the histogram. It is only used when bar = FALSE. It is passed to the function hist with the same default value.

freq

a logical value indicating whether the y axis in the histogram presents frequencies (TRUE) or densities (FALSE). It is only used when bar = FALSE. It is passed to the function hist with the same default value (TRUE if and only if breaks are equidistant; otherwise, FALSE).

reverse

a logical value indicating whether the groups of two directions of significance change. It is only used when dir = "both". The default is FALSE, where the part corresponding to non-significance altered to significance is stacked at the bottom and that corresponding to significance altered to non-significance is stacked at the top in the bar plot or histogram.

xlab

a label for the x axis.

ylab

a label for the y axis.

main

a main title for the plot.

cex.marker

the size of the text about the truncated fragility measures when the argument trun.marker = TRUE and bar = FALSE. The default is 1.

col.border

the color to be used for the border of the bars in the bar plot or the histogram.

col.sig

a vector of two colors for the two directions of significance change. The default includes "forestgreen" (for non-significance altered to significance) and "firebrick" (for significance altered to non-significance), with the opacity setting to alpha.f = 0.1 in adjustcolor.

trun.marker

a logical value indicating whether a text is placed at place of truncated fragility measures (the default is TRUE) in the histogram (bar = FALSE). The text gives information about the truncation.

...

other arguments that can be passed to barplot (when bar = TRUE) or hist (when bar = FALSE).

Details

A bar plot or a histogram is generated. In the bar plot, the x axis presents the values of fragility indexes among the multiple studies or multiple meta-analyses, and the y axis presents the corresponding frequencies (counts). In the histogram, the x axis presents the intervals of fragility indexes or fragility quotients, and the y axis presents the corresponding frequencies (counts) or densities.

Value

None.

References

Lin L (2021). "Factors that impact fragility index and their visualizations." Journal of Evaluation in Clinical Practice, 27(2), 356–64. <doi:10.1111/jep.13428>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.studies and frag.mas for assessing fragility of multiple studies and multiple meta-analyses, respectively.


Plot Method for "frag.nma" Objects

Description

Visualizes the iterative process of event status modifications for deriving the fragility index/quotient of a network meta-analysis with a binary outcome.

Usage

## S3 method for class 'frag.nma'
plot(x, tid1, tid2, xlab, ylab, xlim, ylim, ybreaks = NULL,
     study.marker = TRUE, cex.marker, offset.marker, col.line, lwd,
     legend, x.legend, y.legend, cex.legend, ...)

Arguments

x

an object of class "frag.nma" produced by the function frag.nma.

tid1

the first treatment of the comparison of interest; if not specified, the first comparison in x$tid.f will be used.

tid2

the second treatment of the comparison of interest. Only one comparison can be specified by tid1 and tid2 at one time for plotting.

xlab

a label for the x axis.

ylab

a label for the y axis.

xlim

the x limits c(x1, x2) of the plot.

ylim

the y limits c(y1, y2) of the plot.

ybreaks

a vector of the two numeric values for breaking the y axis or NULL (the default, not breaking the y axis). The two values should be between the total event counts in the two treatment groups specified by tid1 and tid2, and the first value should be less than the second value. It is useful when the total event counts in the two groups differ a lot, leading to a large distance between the two lines representing the event status modifications in the two groups.

study.marker

a logical value indicating whether study labels involved in event status modifications are presented in the plot (the default is TRUE). When using the default, an asterisk represents that the study with an event status modification remains the same as in the previous iteration.

cex.marker

the size of study labels (when study.marker = TRUE) with the default 0.8.

offset.marker

a numeric value controlling the distance between study labels from the lines (the default is 0.2). It is passed to the function text.

col.line

a vector of the two colors for two lines representing the event status modifications in the two treatment groups. The default includes "blue" (for tid1) and "red" (for tid2).

lwd

the width of the lines (the default is 1).

legend

the legend of plot. The default gives the two groups.

x.legend

the x co-ordinate or a keyword, such as "right" (the default), to be used to position the legend. It is passed to legend.

y.legend

the y co-ordinate to be used to position the legend (the default is NULL).

cex.legend

the size of legend text (the default is 1).

...

other arguments that can be passed to plot.default.

Details

A plot showing the iterative process of event status modifications is generated for a specific treatment comparison. The x axis presents the iterations, and the y axis gives the group-specific total event counts.

Value

None.

References

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.nma


Plot Method for "frag.study.all" Objects

Description

Visualizes the fragility of an individual study with a binary outcome.

Usage

## S3 method for class 'frag.study.all'
plot(x, method, modify0, modify1, trun,
     xlab, ylab, xlim, ylim, cex.pts, cex.legend.pval, cex.legend.title,
     col.ori, col.ori.hl, col.f.hl, col.sig, lty.ori, lwd.ori,
     pch, pch.ori, pch.ori.hl, pch.f, pch.f.hl, pch.trun,
     adjust.legend, adjust.seg, legend.pvals, ...)

Arguments

x

an object of class "frag.study.all". It is produced by the function frag.study with its argument all = TRUE.

method

a character string ("Fisher", "chisq", "OR", "RR", or "RD") indicating the method used to calculate the p-value. It must be an element of x$methods; the default is the first method in x$methods.

modify0

a logical value indicating whether event status is modified in group 0 for plotting. The default is TRUE if the range of event status modifications stored in the object x (x$f0.range) is not 0; otherwise, the default is FALSE.

modify1

a logical value indicating whether event status is modified in group 1 for plotting. The default is TRUE if the range of event status modifications stored in the object x (x$f1.range) is not 0; otherwise, the default is FALSE.

trun

a positive numeric value indicating truncation of p-value (on a base-10 logarithmic scale); p-values smaller than this threshold (10^-trun) are truncated. The default is 10.

xlab

a label for the x axis.

ylab

a label for the y axis.

xlim

the x limits c(x1, x2) of the plot.

ylim

the y limits c(y1, y2) of the plot.

cex.pts

the size of points in the plot (the default is 0.5).

cex.legend.pval

the text size of p-values in the legend (the default is 0.6). It is only used when both arguments modify0 and modify1 are TRUE.

cex.legend.title

the size of the legend title (the default is 1). It is only used when both arguments modify0 and modify1 are TRUE.

col.ori

the color of the line(s) depicting the original data (without event status modifications). The default is "gray50".

col.ori.hl

the color of the point depicting the original data (without event status modifications). The default is "black". It is only used when both arguments modify0 and modify1 are TRUE.

col.f.hl

the color of the point(s) for highlighting the minimal event status modifications for altering statistical significance or non-significance. The default is "black". It is only used when both arguments modify0 and modify1 are TRUE.

col.sig

a vector of two colors for non-significant and significant results, accordingly. The default includes "forestgreen" (for non-significant results) and "firebrick" (for significant results). When both arguments modify0 and modify1 are TRUE, they serve as colors of points representing p-values based on different event status modifications, with opacity automatically adjusted for depicting the p-value magnitudes (based on the function adjustcolor with different opacity levels for its argument alpha.f). When only one of the arguments modify0 and modify1 is TRUE, they serve as the background colors for distinguishing non-significance and significance, with the default opacity alpha.f = 0.1 in adjustcolor.

lty.ori

the type of the line(s) depicting the original data (without event status modifications). The default is 2 (dashed).

lwd.ori

the width of the line(s) depicting the original data (without event status modifications). The default is 1.

pch

the symbol of the points in the plot. The default is 16 (filled circle) when both arguments modify0 and modify1 are TRUE, and is 1 (circle) when only one of the arguments modify0 and modify1 is TRUE.

pch.ori

the symbol of the point depicting the original data (without event status modifications). The default is 15 (filled square).

pch.ori.hl

the symbol of the point for highlighting the original data (without event status modifications). The default is 0 (square). It is only used when both arguments modify0 and modify1 are TRUE.

pch.f

the symbol of the point depicting the original data (without event status modifications). The default is 15 (filled square).

pch.f.hl

the symbol of the point(s) for highlighting the minimal event status modifications for altering statistical significance or non-significance. The default is 2 (triangle point up). It is only used when both arguments modify0 and modify1 are TRUE.

pch.trun

the symbol of the point(s) depicting truncated p-values. The default is 3 (plus). It is only used when only one of the arguments modify0 and modify1 is TRUE.

adjust.legend

a positive numeric value for adjusting the width of the legend of p-values. The default is 1.

adjust.seg

a positive integer for adjusting the number of segments in the legend of p-values. The default is 10.

legend.pvals

a numeric value or a vector of numeric values that give additional p-values (e.g., 0.005 and 0.1) to be shown in the legend. The default is NULL.

...

other arguments that can be passed to plot.default.

Details

When both arguments modify0 and modify1 are TRUE, the generated plot presents p-values (with different colors representing their magnitudes) based on all possible event status modifications. The modifications in group 0 are presented on the x axis, and those in group 1 are presented on the y axis. When only one of the arguments modify0 and modify1 is TRUE, a scatter plot is generated, which presents p-values (on a base-10 logarithmic scale) on the y axis against event status modifications in group 0 (if modify0 = TRUE) or group 1 (if modify1 = TRUE) on the x axis.

Value

None.

References

Lin L (2021). "Factors that impact fragility index and their visualizations." Journal of Evaluation in Clinical Practice, 27(2), 356–64. <doi:10.1111/jep.13428>

Lin L, Chu H (2022). "Assessing and visualizing fragility of clinical results with binary outcomes in R using the fragility package." PLOS ONE, 17(6), e0268754. <doi:10.1371/journal.pone.0268754>

See Also

frag.study


Print Method for "frag.ma" Objects

Description

Prints information about the fragility of a meta-analysis with a binary outcome.

Usage

## S3 method for class 'frag.ma'
print(x, ...)

Arguments

x

an object of class "frag.ma" produced by the function frag.ma.

...

other arguments.

Details

The output includes the characteristics of the meta-analysis (the number of studies, events, and samples), the estimated overall effect size, the information about significance (the pre-specified significance level, the null value, the confidence interval, and the p-value), and the fragility index and quotient.

Value

None.

See Also

frag.ma


Print Method for "frag.ma.alpha" Objects

Description

Prints information about the fragility of a meta-analysis with a binary outcome at different statistical significance levels.

Usage

## S3 method for class 'frag.ma.alpha'
print(x, ...)

Arguments

x

an object of class "frag.ma.alpha" produced by the function frag.ma.alpha.

...

other arguments.

Details

The output includes the characteristics of the meta-analysis (the number of studies, events, and samples), the estimated overall effect size, the information about significance (the range of considered significance levels, the null value, and the p-value), and the averages, minimums, and maximums of fragility index and fragility quotient across different statistical significance levels.

Value

None.

See Also

frag.ma.alpha


Print Method for "frag.mas" Objects

Description

Prints information about the fragility of multiple meta-analyses with binary outcomes.

Usage

## S3 method for class 'frag.mas'
print(x, ...)

Arguments

x

an object of class "frag.mas" produced by the function frag.mas.

...

other arguments.

Details

The output includes the number of meta-analyses, the pre-specified significance level, the null value of effect size, and the descriptive information about the fragility of the multiple meta-analyses, such as the median, range (from minimum to maximum), and interquartile range (IQR, from the first quartile to the third quartile) of fragility index and those of fragility quotient.

Value

None.

See Also

frag.mas


Print Method for "frag.nma" Objects

Description

Prints information about the fragility of a network meta-analysis with a binary outcome.

Usage

## S3 method for class 'frag.nma'
print(x, ...)

Arguments

x

an object of class "frag.nma" produced by the function frag.nma.

...

other arguments.

Details

Due to the space limit, the output only includes the basic characteristics of the network meta-analysis (the numbers of studies and treatments), the effect size, and the brief information about fragility index and quotient. More information can be retrieved from the list object x. For example, the estimated effect sizes can be retrieved from x$est.ori, and the directions of significance change corresponding to the fragility index/quotient can be retrieved from x$dir.

Value

None.

See Also

frag.nma


Print Method for "frag.nma.alpha" Objects

Description

Prints information about the fragility of treatment comparison(s) in a network meta-analysis with a binary outcome at different statistical significance levels.

Usage

## S3 method for class 'frag.nma.alpha'
print(x, ...)

Arguments

x

an object of class "frag.nma.alpha" produced by the function frag.nma.alpha.

...

other arguments.

Details

The output includes the basic characteristics of the network meta-analysis (the numbers of studies and treatments), the effect size, and the brief information about the averages of fragility indexes and fragility quotients across different statistical significance levels. More information can be retrieved from the list object x. For example, the fragility indexes at different significance levels can be retrieved from x$FI.

Value

None.

See Also

frag.nma.alpha


Print Method for "frag.studies" Objects

Description

Prints information about the fragility of multiple individual studies with binary outcomes.

Usage

## S3 method for class 'frag.studies'
print(x, ...)

Arguments

x

an object of class "frag.studies" produced by the function frag.studies.

...

other arguments.

Details

The output consists of two parts: 1) the information about the number of studies, the pre-specified significance level, null value(s) (if the odds ratio, relative risk, and/or risk difference are used), the method(s) used to produce p-value(s), and the alternative hypothesis; and 2) the information about the fragility of the multiple studies, including the median, range (from minimum to maximum), and interquartile range (IQR, from the first quartile to the third quartile) of fragility index and those of fragility quotient based on each method considered. The second part about the fragility presents the information grouped by the direction of significance change (significance altered to non-significance and non-significance altered to significance) as well as the overall (ungrouped) information. If both groups have no event status modifications, the second part will not be printed because the fragility needs to be assessed based on certain event status modifications.

Value

None.

See Also

frag.studies


Print Method for "frag.study" Objects

Description

Prints information about the fragility of an individual study with a binary outcome.

Usage

## S3 method for class 'frag.study'
print(x, ...)

Arguments

x

an object of class "frag.study" produced by the function frag.study.

...

other arguments.

Details

The output consists of three parts: 1) the information about the original data, where the 2×\times2 table and the ranges of event status modifications in both groups are presented; 2) the information about the significance, including the pre-specified significance level, null value(s) (if the odds ratio, relative risk, and/or risk difference are used), and the p-value(s) with the associated method and the alternative hypothesis; and 3) the information about the fragility, including the fragility index and fragility quotient based on each method considered, the direction of significance change, and the corresponding minimal event status modification(s) for altering significance or non-significance. If both groups have no event status modifications, the third part will not be printed because the fragility needs to be assessed based on certain event status modifications.

Value

None.

See Also

frag.study


Print Method for "frag.study.alpha" Objects

Description

Prints information about the fragility of an individual study with a binary outcome at different statistical significance levels.

Usage

## S3 method for class 'frag.study.alpha'
print(x, ...)

Arguments

x

an object of class "frag.study.alpha" produced by the function frag.study.alpha.

...

other arguments.

Details

The output consists of three parts: 1) the information about the original data, where the 2×\times2 table and the ranges of event status modifications in both groups are presented; 2) the information about the significance, including the pre-specified significance level, null value(s) (if the odds ratio, relative risk, and/or risk difference are used), and the p-value(s) with the associated method and the alternative hypothesis; and 3) the information about the fragility, including the averages, minimums, and maximums of fragility index and fragility quotient based on each method considered across different statistical significance levels. If both groups have no event status modifications, the third part will not be printed because the fragility needs to be assessed based on certain event status modifications.

Value

None.

See Also

frag.study.alpha