Skip to content

Commit

Permalink
Fix remaining linting
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkucharski committed Jul 2, 2024
1 parent fa4129f commit 83917ff
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/estimate_severity.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,29 @@
pprange <- seq(from = 1e-4, to = 1.0, by = 1e-4)

# if more expected outcomes than observed deaths, set outcomes equal to deaths
if (total_outcomes >= total_deaths){
total_outcomes_checked <- total_outcomes
}else{
total_outcomes_checked <- NA
if (total_outcomes >= total_deaths) {
total_outcomes_checked <- total_outcomes
} else {
total_outcomes_checked <- NA
message(
"Total deaths = ", total_deaths,
" and expected outcomes = ", round(total_outcomes),
" so setting expected outcomes = NA. If we were to assume
total deaths = expected outcomes, it would produce an estimate of 1."
)
}

# get likelihoods using selected function
lik <- func_likelihood(total_outcomes_checked, total_deaths, pprange)

# maximum likelihood estimate - if this is empty, return NA
# Otherwise return 95% confidence interval of likelihood
severity_estimate <- pprange[which.max(lik)]
if (length(severity_estimate)==0){
if (length(severity_estimate) == 0) {
severity_estimate <- NA
severity_lims <- c(NA, NA)
}else{
severity_lims <- range(pprange[lik >=
} else {
severity_lims <- range(pprange[lik >=
(max(lik, na.rm = TRUE) - 1.92)],
na.rm = TRUE)
}
Expand Down

0 comments on commit 83917ff

Please sign in to comment.