-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add time-varying case fatality risk to simulation #101
Conversation
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality looks good @joshwlambert - I only have a few questions and suggestions. My main one would be to add inline comments explaining internal functions a bit more so that other devs can also contribute in future.
I've run the vignette examples which work well. My main suggestion for the time-dependent CFR vignette would be to show cumulative incidence curves rather than daily incidence as this would show the differences between different time-dependent CFR functions more clearly. A small issue, possibly specific to my system, is that the website rendering causes the logo and the first callout to clash (see screenshot).
I'll leave other user comments to @CarmenTamayo or others; Carmen it would be great if you could check whether this and the previous PR meet the requirements of the linked issue.
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.) |
1 similar comment
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.) |
@pratikunterwegs thanks for all the comments.
I'd seen this also before making the PR and was unsure how to fix it. Do you know a way to solve this without changing the length of the vignette title? |
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.) |
Not really, other than adding text above the callout box. |
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.) |
Hi @joshwlambert I saw there had been changes to this PR - shall I take another look today or do you want to push more edits? |
@pratikunterwegs I am finishing off the PR and will re-request a review once the changes are finalised later today. |
Great, just let me know. |
The last 5 commits on this branch have updated the way the user specifies the time-varying death risk and how it is calculated in the The updates are demonstrated in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @joshwlambert - looks good! I've just added a comment on .add_outcome()
which might help to vectorise it and reduce the code some more, hope it helps. Feel free to merge if/once you get feedback on suitability as a fix for the linked issue.
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.) |
…rinciples vignette
…n time_varying_risk
…function signature
…ive error messages
13ae210
to
f16edab
Compare
This PR addresses a feature request made in #36 for time-varying case fatality risk (cfr).
The
create_config()
function is updated to return a$time_varying_death_risk
element in theconfig
list. This element by default isNA
which corresponds to a time-constant death risk (specified byhosp_death_risk
andnon_hosp_death_risk
arguments).An internal function,
time_varying_risk()
is added inside.add_outcome()
to apply the time-varying case fatality risk to both population-wide death risks or age-stratified death risks.time_varying_risk()
is called from withinapply_death_risk()
(which is also defined within.add_outcome()
). Theconfig
argument is added to.add_outcome()
function.A new vignette (
time-varying-cfr.Rmd
) on using the time-varying case fatality risk feature in {simulist} is added. The documentation ofhosp_death_risk
andnon_hosp_death_risk
argument have also been updated to make clear the interpretation of the risk when using constant or time-varying risks.A bullet point is added to the design principles (
design-principles.Rmd
) vignette on input checking on theconfig
list inside the simulation functions instead of withincreate_config()
.Tests for
create_config()
,sim_linelist()
andcheckers
are updated.