## 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
# \donttest{
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)
Run the code above in your browser using DataLab