Skip to content

vaccineff 0.0.2

Latest
Compare
Choose a tag to compare
@davidsantiagoquevedo davidsantiagoquevedo released this 18 Aug 10:18
· 31 commits to main since this release

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:

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.

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 get_dataset() method. The matched cohort contains all the necessary information to estimate vaccine effectiveness.

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)