Releases: epiverse-trace/vaccineff
vaccineff 1.0.0
{vaccineff 1.0.0}
refactors the package's internal structure for better
maintainability.
Breaking Changes
-
estimate_vaccineff()
replaceseffectiveness()
.- It returns an object of class
vaccineff
. - The
at
parameter must always be provided for accurate results.
- It returns an object of class
-
plot.vaccineff_data()
replacesplot_coverage()
. -
cohortdata
has been simplified and reduced to improve examples and
reduce computation time.
vaccineff 0.0.4
{vaccineff 0.0.4}
simplifies data handling by using linelist
objects. Tags are assigned to the outcome, censoring, and vaccine dates using the function make_vaccineff_data
, reducing redundancy in function input parameters.
The new pipeline includes the following three functions and complementary methods: summary
and plot
.
-
make_vaccineff_data
: This function returns an S3 object of the classvaccineff_data
with the study's relevant information. It also allows the creation of a matched cohort to control for confounding variables by settingmatch = TRUE
and passing the appropriateexact
andnearest
arguments. The methodsummary()
can be used to check cohort characteristics, matching balance, and the sizes of matched, excluded, and removed populations. -
plot_coverage
: This function returns a plot of the vaccine coverage or cumulative coverage. If the population is matched, the plot includes the resulting count of doses after matching. -
effectiveness
: This function provides methods for estimating VE using the$HR$ . A summary of the estimation is available viasummary()
, and a graphical representation of the methodology is generated byplot()
.
Breaking changes
The following functions are no longer accessible to users, but they are called within make_vaccineff_data()
:
make_immunization()
match_cohort()
The plot()
method returns log-log
and survival
type plots when receiving an object of type effectiveness
. This deprecates the functions plot_survival()
and plot_loglog()
.
Get started with {vaccineff 0.0.4}
# Create `vaccineff_data`
vaccineff_data <- make_vaccineff_data(
data_set = cohortdata,
outcome_date_col = "death_date",
censoring_date_col = "death_other_causes",
vacc_date_col = "vaccine_date_2",
vaccinated_status = "v",
unvaccinated_status = "u",
immunization_delay = 15,
end_cohort = as.Date("2044-12-31"),
match = TRUE,
exact = c("age", "sex"),
nearest = NULL
)
# Print summary of vaccineff data object
summary(vaccineff_data)
# Plot the vaccine coverage of the total population
plot_coverage(vaccineff_data)
# Estimate the Vaccine Effectiveness at 90 days
ve90 <- effectiveness(vaccineff_data, at = 90)
# Print summary of VE
summary(ve90)
# Loglog plot to check proportional hazards
plot(ve90, type = "loglog")
vaccineff 0.0.3
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)
vaccineff 0.0.2
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)
vaccineff 0.0.1
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()
.