Skip to content

Commit

Permalink
Update defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Sep 3, 2024
1 parent fc68f14 commit c8ab151
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Reworking of `summarize_glm_count()` documentation and all its associated functions to better describe the results and the functions' purpose.
* Added the `.formats` argument to `tabulate_rsp_subgroups` and `tabulate_survival_subgroups` to allow users to specify formats.
* Added the `riskdiff` argument to `tabulate_rsp_subgroups` and `tabulate_survival_subgroups` to allow users to add a risk difference table column, and function `control_riskdiff` to specify settings for the risk difference column.
* Added `"chisq"` as default `method` parameter value to `extract_rsp_subgroups`, `h_odds_ratio_df`, and `h_odds_ratio_subgroups_df`.
* Added `"chisq"` as default `method` parameter value to `extract_rsp_subgroups`.
* Added warning to `tabulate_rsp_subgroups` when `pval` statistic is selected but `df` has not been correctly generated to add p-values to the output table.

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion R/argument_convention.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#' for more information.
#' @param lyt (`PreDataTableLayouts`)\cr layout that analyses will be added to.
#' @param method (`string` or `NULL`)\cr specifies the test used to calculate the p-value for the difference between
#' two proportions. For options, see [test_proportion_diff()]. Defaults to `"chisq"`. If `NULL`, no test is performed.
#' two proportions. For options, see [test_proportion_diff()]. Default is `NULL` so no test is performed.
#' @param na.rm (`flag`)\cr whether `NA` values should be removed from `x` prior to analysis.
#' @param na_str (`string`)\cr string used to replace all `NA` or empty values in the output.
#' @param nested (`flag`)\cr whether this layout instruction should be applied within the existing layout structure _if
Expand Down
4 changes: 2 additions & 2 deletions R/h_response_subgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ h_proportion_subgroups_df <- function(variables,
#' )
#'
#' @export
h_odds_ratio_df <- function(rsp, arm, strata_data = NULL, conf_level = 0.95, method = "chisq") {
h_odds_ratio_df <- function(rsp, arm, strata_data = NULL, conf_level = 0.95, method = NULL) {
assert_valid_factor(arm, n.levels = 2, len = length(rsp))

df_rsp <- data.frame(
Expand Down Expand Up @@ -323,7 +323,7 @@ h_odds_ratio_subgroups_df <- function(variables,
data,
groups_lists = list(),
conf_level = 0.95,
method = "chisq",
method = NULL,
label_all = "All Patients") {
if ("strat" %in% names(variables)) {
warning(
Expand Down
4 changes: 3 additions & 1 deletion R/response_subgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ NULL
#'
#' @inheritParams argument_convention
#' @inheritParams response_subgroups
#' @param method (`string` or `NULL`)\cr specifies the test used to calculate the p-value for the difference between
#' two proportions. For options, see [test_proportion_diff()]. Defaults to `"chisq"`. If `NULL`, no test is performed.
#' @param label_all (`string`)\cr label for the total population analysis.
#'
#' @return A named list of two elements:
Expand Down Expand Up @@ -411,7 +413,7 @@ tabulate_rsp_subgroups <- function(lyt,
#' @export
d_rsp_subgroups_colvars <- function(vars,
conf_level = NULL,
method = "p-value (Chi-Squared Test)") {
method = NULL) {
checkmate::assert_character(vars)
checkmate::assert_subset(c("n_tot", "or", "ci"), vars)
checkmate::assert_subset(
Expand Down
2 changes: 1 addition & 1 deletion man/argument_convention.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions man/d_rsp_subgroups_colvars.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions man/h_response_subgroups.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/testthat/test-h_response_subgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ testthat::test_that("h_odds_ratio_subgroups_df works as expected with groups_lis
subgroups = c("SEX", "BMRKR2")
),
data = adrs,
method = NULL,
groups_lists = list(
BMRKR2 = list(
"low" = "LOW",
Expand Down

0 comments on commit c8ab151

Please sign in to comment.