| Title: | Cost-Effectiveness Analysis Toolkit for Clinical Trials |
|---|---|
| Description: | CEACT (Cost-Effectiveness Analysis Toolkit for Clinical Trials) is a comprehensive R package designed to facilitate the economic evaluation of healthcare interventions in clinical trial settings. It provides tools to compute and visualize Incremental Cost-Effectiveness Ratios (ICERs), Cost-Effectiveness Acceptability Curves (CEAC), Cost-Effectiveness Planes, and Net Monetary Benefit (NMB) tables. The package streamlines cost-utility analyses and supports both observed and bootstrap-based approaches. |
| Authors: | Imad EL BADISY [aut, cre] |
| Maintainer: | Imad EL BADISY <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.5.0 |
| Built: | 2026-06-17 11:55:41 UTC |
| Source: | https://github.com/ielbadisy/ceact |
Performs non-parametric stratified bootstrap resampling for a two-arm trial-based economic evaluation. Resampling is stratified by trial group to preserve arm sizes.
boot_icer(formula, data, ref, R = 1000, ci.type = "bca", na.omit = TRUE)boot_icer(formula, data, ref, R = 1000, ci.type = "bca", na.omit = TRUE)
formula |
A formula of the form |
data |
A data frame containing the variables in the formula. |
ref |
Reference group label. |
R |
Number of bootstrap replications. |
ci.type |
Confidence interval type passed to |
na.omit |
Logical; whether to remove rows with missing values. |
An object of class boot_icer containing a summary table,
bootstrap distribution, observed estimates, formula, reference group, and
matched call.
df <- simulate_ce_trial(n = 100, seed = 123) res <- boot_icer(cost + effect ~ group, data = df, ref = "control", R = 200) summary(res)df <- simulate_ce_trial(n = 100, seed = 123) res <- boot_icer(cost + effect ~ group, data = df, ref = "control", R = 200) summary(res)
Computes observed cost-effectiveness summaries comparing one treatment group
with one reference group. The incremental cost-effectiveness ratio is
ICER = (mean(cost_treatment) - mean(cost_reference)) / (mean(effect_treatment) - mean(effect_reference)).
cea(formula, data, ref, na.omit = TRUE)cea(formula, data, ref, na.omit = TRUE)
formula |
A formula of the form |
data |
A data frame containing the variables used in the formula. |
ref |
Character string specifying the reference group. |
na.omit |
Logical; whether to remove rows with missing values. |
An object of class cea, a data frame with group means, standard
deviations, differences, confidence intervals, and p-values. Attributes
include ICER, delta_cost, delta_effect, formula, ref, and call.
df <- simulate_ce_trial(n = 100, seed = 123) res <- cea(cost + effect ~ group, data = df, ref = "control") summary(res)df <- simulate_ce_trial(n = 100, seed = 123) res <- cea(cost + effect ~ group, data = df, ref = "control") summary(res)
Computes expected incremental net monetary benefit (INMB) and the probability
that treatment is cost-effective across willingness-to-pay thresholds. For a
two-arm trial, INMB(k) = k * DeltaEffect - DeltaCost.
compute_nmb_ceac( x, data = NULL, wtp_range = seq(0, 1e+05, 1000), ref = NULL, R = 1000, ... )compute_nmb_ceac( x, data = NULL, wtp_range = seq(0, 1e+05, 1000), ref = NULL, R = 1000, ... )
x |
Either a |
data |
Data frame required when |
wtp_range |
Numeric vector of willingness-to-pay thresholds. |
ref |
Reference group label required when |
R |
Number of bootstrap replications used when |
... |
Additional arguments passed to |
An object of class "nmb_ceac" with columns WTP, ENMB, and
Prob_CE.
df <- simulate_ce_trial(n = 100, seed = 123) ceac_tbl <- compute_nmb_ceac(cost + effect ~ group, data = df, ref = "control", R = 200, wtp_range = seq(0, 50000, 5000)) head(ceac_tbl)df <- simulate_ce_trial(n = 100, seed = 123) ceac_tbl <- compute_nmb_ceac(cost + effect ~ group, data = df, ref = "control", R = 200, wtp_range = seq(0, 50000, 5000)) head(ceac_tbl)
Varies one treatment-arm parameter while holding observed reference-arm data fixed, then recomputes the ICER or incremental net monetary benefit.
dsa_icer(formula, data, param, range, ref, metric = "ICER", k = 1000)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 variable to vary, usually the cost or effect
variable from |
range |
Numeric vector of values assigned to the treatment arm. |
ref |
Reference group label. |
metric |
Either |
k |
Willingness-to-pay threshold used for INMB. |
A data frame with varied parameter values and resulting metric.
df <- simulate_ce_trial(n = 100, seed = 123) dsa <- dsa_icer(cost + effect ~ group, data = df, param = "effect", range = seq(0.74, 0.82, 0.02), ref = "control", metric = "INMB", k = 20000) head(dsa)df <- simulate_ce_trial(n = 100, seed = 123) dsa <- dsa_icer(cost + effect ~ group, data = df, param = "effect", range = seq(0.74, 0.82, 0.02), ref = "control", metric = "INMB", k = 20000) head(dsa)
Plots the probability that treatment is cost-effective across willingness-to-pay thresholds.
plot_ceac( x, data = NULL, wtp_range = seq(0, 1e+05, 1000), ref = NULL, R = 1000, ... )plot_ceac( x, data = NULL, wtp_range = seq(0, 1e+05, 1000), ref = NULL, R = 1000, ... )
x |
A |
data |
Data frame required when |
wtp_range |
Numeric vector of willingness-to-pay thresholds. |
ref |
Reference group label required when |
R |
Number of bootstrap replications used when |
... |
Additional arguments passed to |
A ggplot object.
df <- simulate_ce_trial(n = 100, seed = 123) res <- boot_icer(cost + effect ~ group, data = df, ref = "control", R = 200) plot_ceac(res, wtp_range = seq(0, 50000, 5000))df <- simulate_ce_trial(n = 100, seed = 123) res <- boot_icer(cost + effect ~ group, data = df, ref = "control", R = 200) plot_ceac(res, wtp_range = seq(0, 50000, 5000))
Visualizes bootstrap replicates of incremental cost and incremental effect.
plot_ceplane(boot_icer_result, k = NULL, subtitle = NULL)plot_ceplane(boot_icer_result, k = NULL, subtitle = NULL)
boot_icer_result |
A |
k |
Optional willingness-to-pay threshold shown as a straight line with
slope |
subtitle |
Optional subtitle text. |
A ggplot object.
df <- simulate_ce_trial(n = 100, seed = 123) res <- boot_icer(cost + effect ~ group, data = df, ref = "control", R = 200) plot_ceplane(res, k = 20000)df <- simulate_ce_trial(n = 100, seed = 123) res <- boot_icer(cost + effect ~ group, data = df, ref = "control", R = 200) plot_ceplane(res, k = 20000)
Creates a line-style sensitivity plot from a data frame generated by
dsa_icer().
plot_tornado(df, metric = "ICER")plot_tornado(df, metric = "ICER")
df |
A data frame from |
metric |
Character string. Either |
A ggplot object.
df <- simulate_ce_trial(n = 100, seed = 123) dsa <- dsa_icer(cost + effect ~ group, data = df, param = "effect", range = seq(0.74, 0.82, 0.02), ref = "control") plot_tornado(dsa, metric = "ICER")df <- simulate_ce_trial(n = 100, seed = 123) dsa <- dsa_icer(cost + effect ~ group, data = df, param = "effect", range = seq(0.74, 0.82, 0.02), ref = "control") plot_tornado(dsa, metric = "ICER")
Generates individual-level cost and effect outcomes for a simple two-arm randomized clinical trial. The function is intended for examples, tutorials, tests, and manuscript demonstrations.
simulate_ce_trial( n = 200, mean_cost = c(5000, 5600), sd_cost = c(900, 1000), mean_effect = c(0.72, 0.78), sd_effect = c(0.1, 0.11), rho = 0.15, seed = NULL, group_names = c("control", "treatment") )simulate_ce_trial( n = 200, mean_cost = c(5000, 5600), sd_cost = c(900, 1000), mean_effect = c(0.72, 0.78), sd_effect = c(0.1, 0.11), rho = 0.15, seed = NULL, group_names = c("control", "treatment") )
n |
Number of participants per arm. |
mean_cost |
Control and treatment mean costs. |
sd_cost |
Control and treatment cost standard deviations. |
mean_effect |
Control and treatment mean effects, for example QALYs. |
sd_effect |
Control and treatment effect standard deviations. |
rho |
Within-person cost-effect correlation used in a Gaussian construction. |
seed |
Optional random seed. |
group_names |
Character vector naming control and treatment arms. |
A data frame with cost, effect, and group.
trial <- simulate_ce_trial(n = 50, seed = 1) head(trial)trial <- simulate_ce_trial(n = 50, seed = 1) head(trial)
A patient-level clinical-trial cost-effectiveness dataset with treatment assignment, total cost, QALYs, and baseline covariates. The dataset is used in teaching examples for trial-based economic evaluation and was described as being provided by the Health Services Research Unit for the textbook Economic Evaluation in Clinical Trials.
trial_ceatrial_cea
A data frame with 500 rows and 10 variables:
Patient identifier.
Treatment indicator, 1 for treatment and 0 for control.
Total cost in US dollars.
Quality-adjusted life-years.
Disease severity, ranging approximately from 0.025 to 0.729.
Race indicator as supplied in the source dataset.
Baseline cost in US dollars.
Baseline QALY.
Sex indicator, 1 for male and 0 for female.
Factor version of treat, with levels control and
treatment.
Health Services Research Unit example dataset used in Glick HA,
Doshi JA, Sonnad SS, Polsky D. Economic Evaluation in Clinical Trials.
Oxford University Press. Also distributed in the ceaR package as
clintrial_cea.