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

Feat iterative match #63

Merged
merged 31 commits into from
Aug 20, 2024
Merged

Feat iterative match #63

merged 31 commits into from
Aug 20, 2024

Conversation

davidsantiagoquevedo
Copy link
Member

This PR introduces an iterative matching routine to avoid underestimating the VE when removing unvaccinated outcomes whose exposure times do not coincide with their vaccinated pair. Three main functions were added:

  1. iterate_match(): Handles the main while loop to search for new pairs. It rematches the population separately, first removing vaccinated individuals and then removing unvaccinated individuals. The loop continues until there are no more matches to perform or a certain threshold is reached.
  2. rematch_(): Controls the re-matching of removed pairs. A tryCatch statement is used to handle possible errors.
  3. capture_warnings(): Captures warning messages to handle tests and to report in the summary of the matching routine.

By introducing these functions, the pipeline of match_static() was changed. The iterative match is performed after the initial adjustment. The row removed was also deprecated from match_summary().

Necessary tests were built for all functions.

R/coh_match.R Show resolved Hide resolved
R/coh_match_iterate.R Outdated Show resolved Hide resolved
R/handler_warnings.R Outdated Show resolved Hide resolved
R/handler_warnings.R Show resolved Hide resolved
R/handler_warnings.R Show resolved Hide resolved
@davidsantiagoquevedo davidsantiagoquevedo merged commit e53f2d1 into main Aug 20, 2024
7 checks passed
@davidsantiagoquevedo davidsantiagoquevedo deleted the feat-iterative-match branch August 20, 2024 11:27
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