Skip to content

Releases: epiverse-trace/vaccineff

vaccineff 0.0.2

05 Aug 07:51
Compare
Choose a tag to compare

This version of {vaccineff} introduces many breaking changes. The number of functions and steps for computing vaccine effectiveness has been drastically reduced. The new pipeline for estimation consists of three main functions:

  1. make_immunization(): Prepares the information on immunization date and vaccine status. It can handle more than one column for vaccine dates and custom vaccine statuses. In such cases, it returns the name of the column that was selected as immunizing and the custom name, if provided.

  2. match_cohort(): This function has been improved and generalized to reduce observation bias in cohorts. The default matching strategy is static, based on nearest and exact characteristics using Mahalanobis distance. The exposure times of the pairs are adjusted after matching. In future releases, rolling calendar matching will be introduced as a more accurate method to account for exposure times. The function returns an S3 object of type match, from which a summary and balance of the cohorts can be printed using the summary() method, and the matched cohort can be extracted using the dataset() method. The matched cohort contains all the necessary information to estimate vaccine effectiveness.

  3. effectiveness(): Receives a (matched) cohort and estimates vaccine effectiveness using the Hazard Ratio (HR). An S3 object of type effectiveness is returned, compatible with the plot and summary methods. Future releases will provide relative risk (RR) as an alternative for cases where the proportional hazards hypothesis is not satisfied.

Get started with {vaccineff 0.0.2}

# Load sample data
data("cohortdata")

# Define the start and end dates of the study
start_cohort <- as.Date("2044-01-01")
end_cohort <- as.Date("2044-12-31")

# Create `data.frame` with information on immunization
cohortdata <- make_immunization(
  data_set = cohortdata,
  outcome_date_col = "death_date",
  censoring_date_col = "death_other_causes",
  immunization_delay = 14,
  vacc_date_col = "vaccine_date_2",
  end_cohort = end_cohort
)
head(cohortdata)

# Match the data
matching <- match_cohort(
  data_set = cohortdata,
  outcome_date_col = "death_date",
  censoring_date_col = "death_other_causes",
  start_cohort = start_cohort,
  end_cohort = end_cohort,
  method = "static",
  exact = "sex",
  nearest = c(age = 1)
)

# Check matching balance and summary
summary(matching)

# Extract matched data
cohortdata_match <- get_dataset(matching)

# Calculate vaccine effectiveness
ve <- effectiveness(
  data_set = cohortdata_match,
  start_cohort = start_cohort,
  end_cohort = end_cohort,
  method = "HR"
)

# View summary of VE
summary(ve)

# Generate plot of method
plot(ve)

vaccineff 0.0.1

03 Jun 14:37
Compare
Choose a tag to compare

Features

vaccineff 0.0.1 provides functions for data wrangling and estimating vaccine effectiveness in a cohort design. A typical estimation pipeline in vaccineff 0.0.1 requires the explicit definition of the immunization dates, vaccine and outcome status, and time to events as follows:

data("cohortdata")

cohortdata$immunization <-
  get_immunization_date(
    data = cohortdata,
    outcome_date_col = "death_date",
    outcome_delay = 0,
    immunization_delay = 14,
    vacc_date_col = c("vaccine_date_1", "vaccine_date_2"),
    end_cohort = as.Date("2044-12-31"),
    take_first = FALSE
  )

cohortdata$vaccine_status <- set_status(
  data = cohortdata,
  col_names = "immunization",
  status = c("v", "u")
)

cohortdata$death_status <- set_status(
  data = cohortdata,
  col_names = "death_date"
)

cohortdata$time_to_death <- get_time_to_event(
  data = cohortdata,
  outcome_date_col = "death_date",
  start_cohort = as.Date("2044-01-01"),
  end_cohort = as.Date("2044-12-31"),
  start_from_immunization = FALSE
)

After defining the previous parameters, vaccine effectiveness is calculated using the function coh_eff_noconf()} , which relies on the implementation of the Cox Model for Proportional Hazards from the {survival} package.

coh_eff_noconf(
  data = cohortdata,
  outcome_status_col = "death_status",
  time_to_event_col = "time_to_death",
  status_vacc_col = "vaccine_status"
)

To assess the Proportional Hazards Hypothesis, vaccineff 0.0.1 uses the p-value of the Schoenfeld test, which is reported in the output of coh_eff_noconf(). Alternative strategies, such as stratifying the cohort, are suggested to satisfy this hypothesis. vaccineff 0.0.1 also provides the function match_cohort() to help users deal with observational bias. This feature is still under development to achieve stronger results.

Basic exploration and visualization can also be done using the functions plot_coverage() and plot_survival().