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

Support relative dates and non-numeric pids #16

Merged
merged 11 commits into from
Oct 15, 2024
Merged

Support relative dates and non-numeric pids #16

merged 11 commits into from
Oct 15, 2024

Conversation

hillalex
Copy link
Member

@hillalex hillalex commented Oct 7, 2024

We should accomodate data sets that have a relative date/day/time column (i.e. natural numbers) rather than absolute dates. Also support non-numeric pids.

Changes:

  • convert input pids to numeric ids for model running, and back again for outputs
  • test to ensure that relative dates work (test that converting the legacy data to relative dates gives the same answers as for absolute dates)
  • added utility function for combining serological data with infection time data
  • removed the time_type argument in the main class initializer. This was used inconsistently, and seems a bit confusing
  • make censored an optional input column (default to all observations uncensored)

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.58%. Comparing base (badf860) to head (988e67a).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
+ Coverage   92.17%   92.58%   +0.40%     
==========================================
  Files           8        8              
  Lines         409      418       +9     
==========================================
+ Hits          377      387      +10     
+ Misses         32       31       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

obs_id = seq_len(.N),
t_since_last_exp = as.integer(day - last_exp_day, units = "days"))]
if (!("censored" %in% colnames(private$data))) {
private$data$censored <- 0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also make censored an optional column (default to all uncensored)

@hillalex hillalex changed the title Support relative dates Support relative dates and non-numeric pids Oct 15, 2024
@hillalex hillalex marked this pull request as ready for review October 15, 2024 11:54
@hillalex hillalex merged commit d74abf2 into main Oct 15, 2024
9 checks passed
@hillalex
Copy link
Member Author

Closes #6

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.

1 participant