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

Breslow-Day test silently ignored if DescTools is not installed #7

Open
overdodactyl opened this issue Dec 24, 2023 · 0 comments
Open

Comments

@overdodactyl
Copy link
Owner

If DescTools is not installed, the Breslow-Day test is silently ignored:

if (requireNamespace("DescTools", quietly = TRUE)) {
predprob = data[[options$pred_varname]]
pred = ifelse(predprob >= options$setthreshold, 1, 0)
tmp <- data.frame(
predprob = predprob,
truth = data[[options$true_varname]],
pred = pred,
group = data[[group_varname]]
)
tmp <- dplyr::filter(tmp, !is.na(group))
tab <- table(tmp$pred, tmp$truth, tmp$group)
suppressWarnings({
bd <- DescTools::BreslowDayTest(tab, OR = NA, correct = FALSE)
})
measure <- dx_measure_df(
measure = "Breslow-Day",
estimate = scales::pvalue(bd$p.value, accuracy = 0.01, add_p = TRUE),
fraction = "",
ci_type = "",
notes = "Mantel-Haenszel OR estimate",
estimate_raw = bd$p.value,
lci_raw = NA,
uci_raw = NA
)
measure$variable <- group_varname
measure$label <- "Overall"
measure$threshold <- options$setthreshold
measure$n <- nrow(tmp)
return(measure)
}

This can lead to some confusion, particularly if using dx_forest.

The main output should include an empty row with a note that DescTools needs to be installed and dx_forest should generate a warning if "Breslow-Day" is part of measures and not available.

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

No branches or pull requests

1 participant