dsa_icer: Perform Deterministic Sensitivity Analysis on ICER or NMB

View source: R/dsa_icer.R

dsa_icerR Documentation

Perform Deterministic Sensitivity Analysis on ICER or NMB

Description

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).

Usage

dsa_icer(formula, data, param, range, ref, metric = "ICER", k = 1000)

Arguments

formula

A formula of the form cost + effect ~ group.

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).

Value

A data frame with the parameter values and resulting ICER or NMB.

Examples

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")

ielbadisy/CEACT documentation built on June 11, 2025, 9:19 p.m.