Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
46d33ff
Refactor feature importance functions
patrickthoral Feb 18, 2026
6a8a9e2
Refactor plot_relative_importance; add multinomial
patrickthoral Feb 18, 2026
97094f8
Refactor group comparison plotting
patrickthoral Feb 18, 2026
42e8d0a
linearity testing for ordered covariates
patrickthoral Feb 18, 2026
410ba12
emphasize post-ICU impairment criteria
patrickthoral Feb 18, 2026
74cac50
add missing closing brace
patrickthoral Feb 18, 2026
b013427
Refactor model weight table generation
patrickthoral Feb 18, 2026
b287f2e
Refactor compare_models; write multinomial CSVs
patrickthoral Feb 18, 2026
767a8ed
fix merge
patrickthoral Feb 18, 2026
17fe913
pooled interaction models
patrickthoral Feb 18, 2026
24473ac
binary/multinomial support to comparison table
patrickthoral Feb 18, 2026
38ad54c
pooled group comparison tables
patrickthoral Feb 18, 2026
7c0092a
Add linearity diagnostics HTML and plots
patrickthoral Feb 18, 2026
24dfe94
Add plot_pooled_group_comparison function
patrickthoral Feb 18, 2026
3d4ef4d
Add multinomial max utility contribution CSVs
patrickthoral Feb 18, 2026
a225764
Update standardized coefficients; add multinomial CSVs
patrickthoral Feb 18, 2026
6f18a8e
Add factor importance figures and reorganize
patrickthoral Feb 18, 2026
202884e
Remove group_comparison_aumc_olvg.png
patrickthoral Feb 18, 2026
d0bf15a
Move pooled interaction models to pooled.R
patrickthoral Feb 18, 2026
627ee43
(stub) test to check plot_group_comparison output
patrickthoral Feb 18, 2026
30e49c6
pooled_ prefix for group comparison figures
patrickthoral Feb 18, 2026
41b9d37
Enable KaTeX math rendering in pkgdown
patrickthoral Feb 19, 2026
a29f055
improve docs
patrickthoral Feb 19, 2026
46f2ea6
update package imports and deps
patrickthoral Feb 19, 2026
5911122
Activate setup steps and add deps in README
patrickthoral Feb 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ RoxygenNote: 7.3.3
Imports:
apollo,
dplyr,
fs,
ggpattern,
ggplot2,
ggsignif,
gt,
katex,
magrittr,
patchwork,
pkgdown,
readxl,
rlang,
stats,
stringr,
svglite,
tidyr
tibble,
tidyr,
utils
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Expand Down
12 changes: 10 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
# Generated by roxygen2: do not edit by hand

export(coefficient_to_variable)
export(compare_models)
export(create_criteria_table)
export(create_group_comparison_table)
export(create_group_comparison_tables)
export(create_model_weights_tables)
export(create_pooled_group_comparison_tables)
export(feature_importance)
export(feature_importance_all)
export(fit_bait_binary)
export(fit_bait_multinomial)
export(fit_pooled_interaction_binary)
export(fit_pooled_interaction_multinomial)
export(fit_pooled_models)
export(load_responses)
export(maximum_utility_contribution)
export(plot_group_comparison)
export(plot_pooled_group_comparison)
export(plot_relative_importance)
export(predict)
export(run_linearity_tests)
export(standardized_coefficients)
export(wald_interaction)
importFrom(magrittr,"%>%")
importFrom(rlang,.data)
importFrom(stats,filter)
Expand Down
6 changes: 3 additions & 3 deletions R/bait_binary.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @export
#'
#' @examples
#' fit_bait_binary()
#' baitlist::fit_bait_binary(elimination_threshold = 1)
fit_bait_binary <- function(elimination_threshold = 0.20) {

groups <- c(
Expand Down Expand Up @@ -163,7 +163,7 @@ fit_bait_binary <- function(elimination_threshold = 0.20) {
coef <- model$estimate
se <- model$robse
wald_stat <- coef^2/se^2
p_value <- 1 - pchisq(wald_stat, df=1)
p_value <- 1 - stats::pchisq(wald_stat, df=1)

# determine coefficients that are above threshold
nonsig <- p_value[(p_value > elimination_threshold)]
Expand Down Expand Up @@ -196,7 +196,7 @@ fit_bait_binary <- function(elimination_threshold = 0.20) {
wald = wald_stat,
p_value = p_value
)
write.csv(tbl_wald,
utils::write.csv(tbl_wald,
fs::path_package("extdata/apollo/binary/", paste0(apollo_control$modelName, "_weights_wald.csv"),
package = "baitlist"),
row.names = FALSE
Expand Down
6 changes: 3 additions & 3 deletions R/bait_multinomial.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @export
#'
#' @examples
#' fit_bait_multinomial()
#' baitlist::fit_bait_multinomial(elimination_threshold = 1)
fit_bait_multinomial <- function(elimination_threshold = 0.20) {

groups <- c(
Expand Down Expand Up @@ -201,7 +201,7 @@ fit_bait_multinomial <- function(elimination_threshold = 0.20) {
coef <- model$estimate
se <- model$robse
wald_stat <- coef^2/se^2
p_value <- 1 - pchisq(wald_stat, df=1)
p_value <- 1 - stats::pchisq(wald_stat, df=1)

# determine coefficients that are above threshold
nonsig <- p_value[(p_value > elimination_threshold)]
Expand Down Expand Up @@ -234,7 +234,7 @@ fit_bait_multinomial <- function(elimination_threshold = 0.20) {
wald = wald_stat,
p_value = p_value
)
write.csv(tbl_wald,
utils::write.csv(tbl_wald,
fs::path_package("extdata/apollo/multinomial/", paste0(apollo_control$modelName, "_weights_wald.csv"),
package = "baitlist"),
row.names = FALSE
Expand Down
Loading