Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refac effectiveness matching #57

Merged
merged 135 commits into from
Jul 16, 2024
Merged

Conversation

davidsantiagoquevedo
Copy link
Member

@davidsantiagoquevedo davidsantiagoquevedo commented Jun 15, 2024

This PR introduces many breaking changes in Vaccineff. The number of functions and steps for computing vaccine effectiveness has been reduced. The new pipeline for estimation consists of three main functions:

  1. make_immunization(): This function 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(): We improved and generalized this function 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(): This function 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.

Related issues

Compatibility: Users can still access the previous estimation pipeline of Vaccineff via release 0.0.1.

davidsantiagoquevedo and others added 30 commits March 13, 2024 16:37
* feat: match function

* refac: added MatchtIt to Description

* feat: documentation, removed  in output. Changed name of function

* roxygen: generate documentation match_cohort

* feat: added basic estructure of function to censore matches

* Fix 38 age interval get age group (#43)

* fix: definition of age interval when (max_val-min_val)%%setp !=0. Added option to set interval '<min_val' when min_val<0

* refac: removed test forcing interval '>max_val', when (max_val-min_val)%%step!=0. Added test for min_val>0

* refac: step=10 on PH-accept test

* feat: pulled description from previous PR

* feat: warning for module of interval by step different to zero. Updated documentation of the function

* simplified tests to control warning

* roxygen: description of warning and lower value

* fix: assert_number replaced by assert_integerish

* fix: upper = max_val for assertion on min_val

* style: documentation

* fix: warning message for (max-min)%%step!=0

* roxygen: automatic update

* fix: assert_integerish replaced by assert_int, better for integer numbers. Removed upper check for min_val to avoid redundancy with lower check for max_mal

* fix: example in documentation

* feat: test for non-integer values

* refac: simplified workflow of match_cohort. Set method = nearest by default and ratio = 1 in matchit

* fix: documentation reflecting changes in match_cohort()

* roxygen: refac match_cohort

* feat: documentation censore_match

* roxygen: documentation censore_cohort

* fix: example in documentation of both functions and column selection excluding weights to pass gp()

* roxygen: fixed examples

* feat: test for basic expectations and minimum censoring date

* fix: return ordered datetype column matching with order of data frame

* fix: test for minimum values. Added test for datetype

* feat: tests for match_cohort

* added MatchIt to wordlist

* refac: replaced 'censore' by 'censor'. This misspelling had propagated throughout all the new functions

* removed duplicated test

* refac: added control for censoring date of matches. No censoring if member of couple presents outcome before censoring date

* feat: test for outcome date before censoring date

* sytle: lintr line 73

* roxygen: changes in documentation by adding outcome_date_col to params

* feat: input checks censor_match

* refac: censor_match() renamed as get_censoring_date_match

* refac: removed caliper from input.  receives it now
…orrecteness of estimation, simplified output and names
R/coh_eff_utils.R Show resolved Hide resolved
R/coh_eff_hr.R Outdated Show resolved Hide resolved
R/coh_effectiveness.R Show resolved Hide resolved
R/coh_effectiveness.R Outdated Show resolved Hide resolved
R/coh_eff_utils.R Outdated Show resolved Hide resolved
R/coh_match_utils.R Outdated Show resolved Hide resolved
R/coh_match_utils.R Outdated Show resolved Hide resolved
R/coh_match_utils.R Outdated Show resolved Hide resolved
R/coh_match_utils.R Outdated Show resolved Hide resolved
R/coh_match_utils.R Outdated Show resolved Hide resolved
@epiverse-trace epiverse-trace deleted a comment from GeraldineGomez Jul 16, 2024
@davidsantiagoquevedo davidsantiagoquevedo merged commit f322f6f into main Jul 16, 2024
7 checks passed
@davidsantiagoquevedo davidsantiagoquevedo deleted the refac-effectiveness-matching branch July 16, 2024 16:52
This was referenced Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants