frag.studies: Assessing Fragility of Multiple Individual Studies With...

Description Usage Arguments Value References See Also Examples

View source: R/frag.studies.R

Description

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

Usage

1
2
3
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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
## 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 representing 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("toprigh", 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))

fragility documentation built on Aug. 12, 2020, 5:07 p.m.