cea | R Documentation |
Computes observed summary statistics for a cost-effectiveness analysis comparing two groups (typically control and treatment). This includes mean and standard deviation of cost and effect, differences (deltas), confidence intervals, p-values from t-tests, and the Incremental Cost-Effectiveness Ratio (ICER).
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 |
A character string specifying the reference group in the |
na.omit |
Logical; whether to remove rows with missing values. Default is |
An object of class cea
, which is a data frame with the following columns:
"Mean Cost" or "Mean Effect"
Mean and SD for the control group
Mean and SD for the treatment group
Difference between treatment and control
95% confidence interval for the difference
P-value from a t-test comparing groups
The object also contains attributes for the ICER, formula, reference group, and matched call.
set.seed(123)
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)
)
res <- cea(cost + effect ~ group, data = df, ref = "control")
print(res)
summary(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.