Skip to content

Commit

Permalink
Perform missingness check on the raw data
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Oct 8, 2024
1 parent 07d5b2d commit 899717a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions R/estimate_secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,20 @@ estimate_secondary <- function(data,
assert_logical(verbose)

reports <- data.table::as.data.table(data)
secondary_reports_dirty <- reports[, list(date, confirm = secondary)]
secondary_reports <- create_clean_reported_cases(
secondary_reports_dirty,
filter_leading_zeros = filter_leading_zeros,
zero_threshold = zero_threshold
)

# If the user is using the default treatment of NA's as missing and
# their data has implicit or explicit NA's, inform them of what's
# happening and provide alternatives.
obs <- check_na_setting_against_data(
obs = obs,
data = secondary_reports_dirty,
data = reports,
cols_to_check = c("date", "primary", "secondary")
)
secondary_reports_dirty <- reports[, list(date, confirm = secondary)]
secondary_reports <- create_clean_reported_cases(
secondary_reports_dirty,
filter_leading_zeros = filter_leading_zeros,
zero_threshold = zero_threshold
)
## fill in missing data (required if fitting to prevalence)
complete_secondary <- create_complete_cases(secondary_reports)
## fill down
Expand Down

0 comments on commit 899717a

Please sign in to comment.