Type: | Package |
Title: | Meta-Analytical Implementation to Identify Who Benefits Most from Treatments |
Version: | 0.2.0 |
Description: | A tool for implementing so called 'deft' approach (see Fisher, David J., et al. (2017) <doi:10.1136/bmj.j573>) and model visualization. |
License: | GPL-3 |
URL: | https://github.com/ShixiangWang/metawho |
BugReports: | https://github.com/ShixiangWang/metawho/issues |
Depends: | metafor, R (≥ 3.5) |
Imports: | dplyr, forestmodel, magrittr, purrr, rlang (≥ 0.1.2), stats |
Suggests: | covr, knitr, rmarkdown, roxygen2, testthat |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.0.0 |
NeedsCompilation: | no |
Packaged: | 2019-12-06 14:56:21 UTC; Shixiang |
Author: | Shixiang Wang |
Maintainer: | Shixiang Wang <w_shixiang@163.com> |
Repository: | CRAN |
Date/Publication: | 2019-12-06 16:00:02 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Implement deft method
Description
'deft' method is a meta-analytical approach to pool conclusion from multiple studies. More details please see references.
Usage
deft_do(prepare, group_level, method = "FE")
Arguments
prepare |
a result |
group_level |
level of subgroup, should be a character vector with
length 2 and the reference should put in the first. For example, if you
have 'Male' and 'Female' groups and want compare 'Female' with 'Male', then
should set |
method |
character string specifying whether a fixed- or a random/mixed-effects model should be fitted. A fixed-effects model (with or without moderators) is fitted when using |
Details
About model fit, please see metafor::rma()
.
Value
a list
which class is 'deft'.
Author(s)
Shixiang Wang w_shixiang@163.com
References
Fisher, David J., et al. "Meta-analytical methods to identify who benefits most from treatments: daft, deluded, or deft approach?." bmj 356 (2017): j573.
Wang, Shixiang, et al. "The predictive power of tumor mutational burden in lung cancer immunotherapy response is influenced by patients' sex." International journal of cancer (2019).
Examples
data("wang2019")
deft_do(wang2019, group_level = c("Male", "Female"))
Prepare log transformation data for effect size estimation according to confidence level and distribution
Description
A variety of different outcome measures which used in meta-analysis as input are in the form of log, such as hazard ratio (HR). This function is used to do log transformation to calculate effect size and standard error. Then the result can be easier used for model fit.
Usage
deft_prepare(data, conf_level = 0.05)
Arguments
data |
a |
conf_level |
a number specify confidence level, default is 0.05. |
Value
a data.frame
Author(s)
Shixiang Wang w_shixiang@163.com
References
Wang, Shixiang, et al. "The predictive power of tumor mutational burden in lung cancer immunotherapy response is influenced by patients' sex." International journal of cancer (2019).
Examples
### specify hazard ratios (hr)
hr <- c(0.30, 0.11, 1.25, 0.63, 0.90, 0.28)
### specify lower bound for hr confidence intervals
ci.lb <- c(0.09, 0.02, 0.82, 0.42, 0.41, 0.12)
### specify upper bound for hr confidence intervals
ci.ub <- c(1.00, 0.56, 1.90, 0.95, 1.99, 0.67)
### specify sample number
ni <- c(16L, 18L, 118L, 122L, 37L, 38L)
### trials
trial <- c(
"Rizvi 2015", "Rizvi 2015",
"Rizvi 2018", "Rizvi 2018",
"Hellmann 2018", "Hellmann 2018"
)
### subgroups
subgroup <- rep(c("Male", "Female"), 3)
entry <- paste(trial, subgroup, sep = "-")
### combine as data.frame
wang2019 <-
data.frame(
entry = entry,
trial = trial,
subgroup = subgroup,
hr = hr,
ci.lb = ci.lb,
ci.ub = ci.ub,
ni = ni,
stringsAsFactors = FALSE
)
deft_prepare(wang2019)
Show deft result
Description
Show deft result
Usage
deft_show(
deft,
element,
study_labels = NULL,
headings = list(study = ifelse(element == "all", "Study-subgroup", "Study"), n = "N",
measure = NULL, ci = "HR (95% CI)"),
trans = base::exp,
show_model = ifelse(element == "all", FALSE, TRUE),
show_stats = list(`I^2` = rlang::quo(sprintf("%0.1f%%", I2)), p =
rlang::quo(format.pval(QEp, digits = 2))),
...
)
Arguments
deft |
result from deft_do. |
element |
'all' or 'subgroup'. |
study_labels |
labels for studies. |
headings |
a list for controlling plot headings. |
trans |
an optional transform function used on the numeric data for plotting the axes |
show_model |
a logical value, if |
show_stats |
a |
... |
other arguments except 'panels', 'trans', 'study_labels',
and 'show_stats' passed to |
Value
a ggplot
object
Author(s)
ShixiangWang w_shixiang@163.com
Examples
data("wang2019")
res <- deft_do(wang2019, group_level = c("Male", "Female"))
p1 <- deft_show(res, "all")
p1
p2 <- deft_show(res, "subgroup")
p2
Tidy eval helpers
Description
-
sym()
creates a symbol from a string andsyms()
creates a list of symbols from a character vector. -
enquo()
andenquos()
delay the execution of one or several function arguments.enquo()
returns a single quoted expression, which is like a blueprint for the delayed computation.enquos()
returns a list of such quoted expressions. -
expr()
quotes a new expression locally. It is mostly useful to build new expressions around arguments captured withenquo()
orenquos()
:expr(mean(!!enquo(arg), na.rm = TRUE))
. -
as_name()
transforms a quoted variable name into a string. Supplying something else than a quoted variable name is an error.That's unlike
as_label()
which also returns a single string but supports any kind of R object as input, including quoted function calls and vectors. Its purpose is to summarise that object into a single label. That label is often suitable as a default name.If you don't know what a quoted expression contains (for instance expressions captured with
enquo()
could be a variable name, a call to a function, or an unquoted constant), then useas_label()
. If you know you have quoted a simple variable name, or would like to enforce this, useas_name()
.
To learn more about tidy eval and how to use these tools, visit https://tidyeval.tidyverse.org and the Metaprogramming section of Advanced R.
Hazard ratio (HR) for disease progression analysis comparing TMB-high with TMB-low in three NSCLC datasets
Description
Hazard ratio (HR) for disease progression analysis comparing TMB-high with TMB-low in three NSCLC datasets
Format
a data.frame
Source
Wang, Shixiang, et al. "The predictive power of tumor mutational burden in lung cancer immunotherapy response is influenced by patients' sex." International journal of cancer (2019).
Examples
data("wang2019")