Create data frame ready to use for tipping point analysis
Source:R/create_tipmap_data.R
create_tipmap_data.Rd
Combines new trial data created by createTargetData()
, a posterior distribution created by create_posterior_data()
and a
robust MAP prior using RBesT::automixfit()
and an optional meta-analysis, e.g. created using the meta
package, into a data frame
needed for the functions tipmap_plot()
and get_tipping_point()
.
Arguments
- new_trial_data
A data frame containing data on the new trial in the target population. See
create_new_trial_data()
.- posterior
A mixture combining MAP prior and target population. See
create_posterior_data()
.- map_prior
A robust MAP prior created by
RBesT::automixfit()
.- meta_analysis
A data frame containing a meta-analysis of trial(s) to be borrowed from. See
createPriorData()
.
Value
A data frame ready to be used for tipmap_plot()
and get_tipping_point()
See also
[create_new_trial_data()], [create_posterior_data()], [tipmap_plot()] and [get_tipping_points()].
Examples
# specify new trial data
new_trial_data <- create_new_trial_data(n_total = 30, est = 1.5, se = 2.1)
# read MAP prior data
map_prior <- load_tipmap_data("tipmapPrior.rds")
# read posterior data
posterior <- load_tipmap_data("tipPost.rds")
tip_dat <- create_tipmap_data(
new_trial_data = new_trial_data,
posterior = posterior,
map_prior = map_prior
)