Learn R Programming

multinma (version 0.8.0)

example_smk_nodesplit: Example smoking node-splitting

Description

Calling example("example_smk_nodesplit") will run node-splitting models with the smoking cessation data, using the code in the Examples section below. The resulting nma_nodesplit_df object smk_fit_RE_nodesplit will then be available in the global environment.

Arguments

Details

Smoking node-splitting for use in examples.

Examples

Run this code
# Set up network of smoking cessation data
head(smoking)

smk_net <- set_agd_arm(smoking,
                       study = studyn,
                       trt = trtc,
                       r = r,
                       n = n,
                       trt_ref = "No intervention")

# Print details
smk_net

# \donttest{
# Fitting all possible node-splitting models
smk_fit_RE_nodesplit <- nma(smk_net, refresh = if (interactive()) 200 else 0,
                            consistency = "nodesplit",
                            trt_effects = "random",
                            prior_intercept = normal(scale = 100),
                            prior_trt = normal(scale = 100),
                            prior_het = normal(scale = 5))
# }

# \dontshow{
if (requireNamespace("pkgdown", quietly = TRUE) && pkgdown::in_pkgdown()) {
  assign("smk_net", smk_net, .GlobalEnv)
  assign("smk_fit_RE_nodesplit", smk_fit_RE_nodesplit, .GlobalEnv)
}
# }

Run the code above in your browser using DataLab