Calculates vaccine efficacy and confidence interval as described in Dudasova et al., 2024, BMC Med Res Methodol and Dudasova et al., 2024, NPJ Vaccines
ve(Fit, Data, nboot =2000)
Arguments
Fit: an object of class inheriting from "glm" or "coxph" representing the fitted model
Data: a data frame containing the variables in the fitted model; data must include a column called "vaccine" with binary indicator of vaccination status
nboot: a numeric value for number of bootstrap samples for confidence interval construction
Returns
a value of vaccine efficacy VE and lower and upper bound of confidence interval CI
Examples
#' # Load required packageslibrary(survival)# Load an example datasetdata(data_temp)# Fit logistic model relating neutralizing titer to disease statuslogisticFit <- glm(disease_any ~ nAb1, data = data_temp, family = binomial())# Fit Cox proportional hazards model relating neutralizing titer # to time to disease or end of follow-upcoxFit <- coxph(Surv(time_event, disease_any)~ nAb1, data = data_temp)# Estimate vaccine efficacy and 95\% confidence interval based on the fitted modelsve(logisticFit, data_temp, nboot =500)ve(coxFit, data_temp, nboot =500)