coxphParametricSampling {vaxpmx} | R Documentation |
Accounting for the uncertainty on the fitted "coxph"
model and observed data
Description
coxphParametricSampling
is used for vaccine efficacy confidence interval construction.
It provides a vector of vaccine efficacy values, with length of nboot
. 95% confidence interval, defined by 2.5th and 97.5th quantile of this vector,
accounts for the uncertainty on the model fit (via parametric resampling of the posterior distribution of the model parameters) and observed data (via bootstrapping).
Usage
coxphParametricSampling(Fit, nboot = 2000, Data.vaccinated, Data.control)
Arguments
Fit |
an object of class inheriting from |
nboot |
a numeric value for number of bootstrap samples for confidence interval construction |
Data.vaccinated |
a data frame for the vaccinated group, containing the variables in the fitted model |
Data.control |
a data frame for the control group, containing the variables in the fitted model |
Value
a vector of vaccine efficacy values VE_set
, with length of nboot
Examples
# Load required packages
library(dplyr)
library(survival)
# Load an example dataset
data(data_temp)
Data.vaccinated <- filter(data_temp, vaccine == 1)
Data.control <- filter(data_temp, vaccine == 0)
# Fit Cox proportional hazards model relating neutralizing titer
# to time to disease or end of follow-up
coxFit <- coxph(Surv(time_event, disease_any) ~ nAb1, data = data_temp)
# Estimate 95\% confidence interval of vaccine efficacy based on the fitted model
efficacySet <- coxphParametricSampling(coxFit, nboot = 500, Data.vaccinated, Data.control)
CI <- lapply(EfficacyCI(efficacySet),"*", 100)