dsa_icer | R Documentation |
This function varies a single parameter in the treatment group while keeping all others fixed, and computes the resulting Incremental Cost-Effectiveness Ratio (ICER) or Net Monetary Benefit (NMB).
dsa_icer(formula, data, param, range, ref, metric = "ICER", k = 1000)
formula |
A formula of the form |
data |
A data frame. |
param |
Name of the parameter to vary (e.g., "effect"). |
range |
A numeric vector of values for the parameter (e.g., seq(0.6, 0.8, 0.01)). |
ref |
Character string specifying the reference group (e.g., "control"). |
metric |
Character string: either "ICER" or "NMB". |
k |
Willingness-to-pay threshold (required for NMB). |
A data frame with the parameter values and resulting ICER or NMB.
df <- data.frame(
cost = c(rnorm(100, 500, 100), rnorm(100, 600, 120)),
effect = c(rnorm(100, 0.6, 0.05), rnorm(100, 0.65, 0.06)),
group = rep(c("control", "treatment"), each = 100)
)
dsa_result <- dsa_icer(cost + effect ~ group, data = df, param = "effect",
range = seq(0.6, 0.7, 0.01), ref = "control", metric = "ICER")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.