Skip to content

vaccineff 0.0.3

Compare
Choose a tag to compare
@davidsantiagoquevedo davidsantiagoquevedo released this 16 Sep 12:40
· 356 commits to main since this release

This version of {vaccineff} introduces an iterative matching routine within match_cohort(). After adjusting the exposure times of the pairs, new pairs are created between the removed ones and the unmatched population. The new matches with inconsistent exposure times are removed again, and the procedure is repeated until no new pairs can be made. The usage of all the functions remains unchanged by this update.

Get started with {vaccineff 0.0.3}

# 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)