The cost-effectiveness acceptance curve (CEAC) is a tool used to describe the output of a probabilistic sensitivity analysis performed on models used in the economic evaluation of health technologies. It communicates the probability of cost effectiveness conditional on our willingness to pay the threshold to obtain each unit of effectiveness or QALY. While this blog post will not provide the best treatment of the theory behind CEACs, it will provide you with some information on how to calculate them in R.
Preliminary: Simulating cost-effectiveness data.
For the calculation of CEAC, I have chosen to simulate data on 2000 treated and untreated patients (1000 in each group). If you are working with (real) patient level data using a pure benefit regression framework would be more appropriate, but we can view this crude simulation as a communication of the output from some probabilistic sensitivity analysis of a model Are. While the seed is not required to be set, it helps to replicate the picture you see above.
I have also included the code for the CE aircraft which is production
# load package library(‘ggplot2’) library(‘ggthemes’) # set seed. simulation cost control_cost<-rnorm(1000,1000,200) treatment_cost<-rnorm(1000,1500,200) #create incremental cost D_cost<-treatment_cost-control_cost D_QALYs<-treatment_QALYs-control_QALYs #CE data CE data<-data.frame( D_Costs,D_QALYs) #plot CE plane ggplot(CEdata,aes(y=D_Costs))+ geom_point(aes(x=D_QALYs),color="blue")+ geom_vline(xintercept=0,size=1)+ geom_hline(yintercept =0,size=1)+ xlim(-1,1)+ xlab("incremental QALYs")+ ylab("incremental cost")+ ggtitle("CE plain")
To actually code your CEAC we need to convert the measures of incremental costs and impacts into incremental net benefits. I do this by first creating a list of willingness to pay thresholds that we will consider, creating an array to store the data and then using a loop to populate this array
#Create threshold vector T_Names<-c("T0","T5000","T10000","T15000","T20000","T250000") threshold<-c(0,5000,10000,15000,20000,25000) #Create Dataframe id<-seq(1,1000) df<-matrix(NA,nrow=1000,ncol=6,dimnames=list(NA,WTP=T_Names)) #For loop for Incremental Net Benefits calculation for (i in 1:6)[,i]
This blog post has demonstrated a way to calculate the cost-effectiveness acceptance curve in R from scratch. There is likely a better way to calculate each probability of cost effectiveness at each threshold as a loop but the simplest solution is to calculate each probability directly.