Skip to content

Conversation

@joshwlambert
Copy link
Member

This PR updates the estimate_from_individual_data.Rmd vignette to use {simulist} to simplify the simulation step and use the truncation functionality to correctly truncate the data.

It also updates the plot of onset and outcome delay by including cases that have symptom onset before the truncation date but do not yet have an outcome (right censored).

In text R code is added to ensure the case fatality risk (CFR) estimates exactly match and are kept up-to-date with the code chunks.

{simulist} is added as a suggested dependency for use in the vignettes. Note this uses the GitHub version of {simulist} so this will need changing once the new version of {simulist} is released on CRAN.

@joshwlambert joshwlambert added the documentation Improvements or additions to documentation label Apr 11, 2025
@github-actions
Copy link

This pull request:

  • Adds 6 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 0 existing dependencies (direct and indirect)
  • Removes 0 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@github-actions
Copy link

This pull request:

  • Adds 6 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 0 existing dependencies (direct and indirect)
  • Removes 0 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

Copy link
Member

@adamkucharski adamkucharski left a comment

Choose a reason for hiding this comment

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

Thanks for putting together. I've pushed a couple of tweaks:

  • Made delays more clearly different with smaller s.d.
  • Added a condition in the cfr_estimate_unadjusted calculation to only include onsets that have occurred before max_obs (otherwise this method will outperform because it can effecitvely see the future).

@github-actions
Copy link

This pull request:

  • Adds 6 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 0 existing dependencies (direct and indirect)
  • Removes 0 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@github-actions
Copy link

This pull request:

  • Adds 6 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 0 existing dependencies (direct and indirect)
  • Removes 0 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@github-actions
Copy link

This pull request:

  • Adds 6 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 0 existing dependencies (direct and indirect)
  • Removes 0 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@joshwlambert
Copy link
Member Author

Thanks for reviewing @adamkucharski.

I think this can now be merged.

One question from the change you pushed, it looks like the addition of trunc_linelist$date_outcome < max_obs does not influence the total deaths and total outcomes calculations. simulist::truncate_linelist() should not return any outcome dates that are after the maximum observation date. Therefore, I don't think this inequality check is required.

Can you let me know if you've seen outcome dates after the maximum observation date? As this might require a change in {simulist}.

@adamkucharski
Copy link
Member

I get total_deaths = 25 with that additional conditional and 33 without. total_outcomes = 115 with conditional and 284 without (i.e. the simple calculation with known outcomes is unbiased without that conditional, which it shouldn't be in real-time if the delays are different).

This is with simulist version 0.5.0.

I think the issue is that the truncation sets date_outcome = NA but still has the outcome so trunc_linelist$outcome == "died" returns all deaths, even those without a date value

@joshwlambert
Copy link
Member Author

Yes that's the case with {simulist} v0.5.0. I've fixed this in the development version of {simulist} on GitHub (v0.5.0.9000).

I'll release a new version of {simulist} at the end of this week and then we can merge this PR and remove the added inequality check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants