From 95158c91cf607e3effc8e838e8e8ccb5c985dff2 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Fri, 1 Sep 2023 19:39:39 +0800 Subject: [PATCH] change version to 0.9.0, [skip vbump] (#1052) # Pull Request Fixes #nnn --------- Co-authored-by: Melkiades --- DESCRIPTION | 2 +- NEWS.md | 11 ++++++----- R/prop_diff_test.R | 3 +-- R/summarize_glm_count.R | 2 +- R/utils_checkmate.R | 1 - inst/REFERENCES.bib | 26 ++++++++++++++++++++++++++ man/assertions.Rd | 2 -- man/h_glm_count.Rd | 6 +++--- man/h_prop_diff_test.Rd | 3 +-- 9 files changed, 39 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cd1c342f38..7f564e4e7e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tern Title: Create Common TLGs Used in Clinical Trials -Version: 0.8.5.9020 +Version: 0.9.0 Date: 2023-09-01 Authors@R: c( person("Joe", "Zhu", , "joe.zhu@roche.com", role = c("aut", "cre")), diff --git a/NEWS.md b/NEWS.md index d7c9b3e31c..8490df172b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,11 +1,12 @@ -# tern 0.8.5.9020 +# tern 0.9.0 +### New Features +* Added `stat_propdiff_ci` function to calculate proportion/risk difference and CI. +* Added risk difference column functionality via the `riskdiff` argument to functions `count_occurrences`, `count_occurrences_by_grade`, `count_patients_with_event`, `count_patients_with_flags`, `analyze_num_patients`, and `summarize_num_patients`. ### Enhancements -* Refactored `a_summary` to no longer use helper function `create_afun_summary`. -* Refactored `summarize_vars` and `compare_vars` to use refactored `a_summary`. +* Refactored the function `a_summary` to no longer use the helper function `create_afun_summary`. +* Refactored functions `summarize_vars` and `compare_vars` to use the refactored `a_summary` function. * Created new internal helper functions `ungroup_stats` to ungroup statistics calculated for factor variables, and `a_summary_internal` to perform calculations for `a_summary`. -* Added `stat_propdiff_ci` function to calculate proportion/risk difference and CI. -* Added risk difference column functionality via the `riskdiff` argument to `count_occurrences`, `count_occurrences_by_grade`, `count_patients_with_event`, `count_patients_with_flags`, `analyze_num_patients`, and `summarize_num_patients`. ### Bug Fixes * Fixed bug in `s_count_occurrences_by_grade` so that "missing" grade always appears as the final level. diff --git a/R/prop_diff_test.R b/R/prop_diff_test.R index 4a18f392a2..80cb1e17a2 100644 --- a/R/prop_diff_test.R +++ b/R/prop_diff_test.R @@ -212,8 +212,7 @@ prop_cmh <- function(ary) { #' @describeIn h_prop_diff_test performs the Chi-Squared test with Schouten correction. #' -#' @seealso For information on the Schouten correction (Schouten, 1980), -#' visit \url{https://onlinelibrary.wiley.com/doi/abs/10.1002/bimj.4710220305}. +#' @seealso Schouten correction is based upon \insertCite{Schouten1980-kd;textual}{tern}. #' #' #' @keywords internal diff --git a/R/summarize_glm_count.R b/R/summarize_glm_count.R index 45fb7415ed..b8f6489a61 100644 --- a/R/summarize_glm_count.R +++ b/R/summarize_glm_count.R @@ -169,7 +169,7 @@ h_glm_count <- function(.var, #' @param .df_row (`data.frame`)\cr data set that includes all the variables that are called in `.var` and `variables`. #' @param conf_level (`numeric`)\cr value used to derive the confidence interval for the rate. #' @param obj (`glm.fit`)\cr fitted model object used to derive the mean rate estimates in each treatment arm. -#' @param `arm` (`string`)\cr group variable, for which the covariate adjusted means of multiple groups will be +#' @param arm (`string`)\cr group variable, for which the covariate adjusted means of multiple groups will be #' summarized. Specifically, the first level of `arm` variable is taken as the reference group. #' #' @return diff --git a/R/utils_checkmate.R b/R/utils_checkmate.R index 8b3abcff26..c01af2aca6 100644 --- a/R/utils_checkmate.R +++ b/R/utils_checkmate.R @@ -11,7 +11,6 @@ #' @param na_level (`character`)\cr the string you have been using to represent NA or #' missing data. For `NA` values please consider using directly [is.na()] or #' similar approaches. -#' @param ... a collection of objects to test. #' #' @return Nothing if assertion passes, otherwise prints the error message. #' diff --git a/inst/REFERENCES.bib b/inst/REFERENCES.bib index 88527d563b..879f39c540 100644 --- a/inst/REFERENCES.bib +++ b/inst/REFERENCES.bib @@ -25,3 +25,29 @@ @ARTICLE{Yan2010-jt month = aug, year = 2010 } + + +% The entry below contains non-ASCII chars that could not be converted +% to a LaTeX equivalent. +@ARTICLE{Schouten1980-kd, + title = "Comparing two independent binomial proportions by a modified chi + square test", + author = "Schouten, H J A and Molenaar, I W and Van Strik, R and Boomsma, + A", + abstract = "When using the chi square test to compare the proportions of + successes in two independent binomial samples, a new continuity + correction is proposed, which equals half the size of the + smaller sample. Exact computations of unconditional + tailā€probabilities, together with a theoretical argument, show + that this correction is more appropriate than the YATES + correction. This version of the chi square test is still + conservative, but less so, and as a consequence more powerful, + than the YATES corrected test.", + journal = "Biom. J.", + publisher = "Wiley", + volume = 22, + number = 3, + pages = "241--248", + year = 1980, + language = "en" +} diff --git a/man/assertions.Rd b/man/assertions.Rd index 4be1d5379d..62d59e7564 100644 --- a/man/assertions.Rd +++ b/man/assertions.Rd @@ -86,8 +86,6 @@ Exact expected length of \code{x}.} \item{include_boundaries}{(\code{logical})\cr whether to include boundaries when testing for proportions.} - -\item{...}{a collection of objects to test.} } \value{ Nothing if assertion passes, otherwise prints the error message. diff --git a/man/h_glm_count.Rd b/man/h_glm_count.Rd index daafc82a5e..0f38d0331d 100644 --- a/man/h_glm_count.Rd +++ b/man/h_glm_count.Rd @@ -41,10 +41,10 @@ used in the regression (poisson, quasipoisson).} \item{obj}{(\code{glm.fit})\cr fitted model object used to derive the mean rate estimates in each treatment arm.} -\item{conf_level}{(\code{numeric})\cr value used to derive the confidence interval for the rate.} - -\item{`arm`}{(\code{string})\cr group variable, for which the covariate adjusted means of multiple groups will be +\item{arm}{(\code{string})\cr group variable, for which the covariate adjusted means of multiple groups will be summarized. Specifically, the first level of \code{arm} variable is taken as the reference group.} + +\item{conf_level}{(\code{numeric})\cr value used to derive the confidence interval for the rate.} } \value{ \itemize{ diff --git a/man/h_prop_diff_test.Rd b/man/h_prop_diff_test.Rd index 8f7ef0882a..50938a4bef 100644 --- a/man/h_prop_diff_test.Rd +++ b/man/h_prop_diff_test.Rd @@ -43,7 +43,6 @@ Helper functions to implement various tests on the difference between two propor \seealso{ \code{\link[=prop_diff_test]{prop_diff_test()}} for implementation of these helper functions. -For information on the Schouten correction (Schouten, 1980), -visit \url{https://onlinelibrary.wiley.com/doi/abs/10.1002/bimj.4710220305}. +Schouten correction is based upon \insertCite{Schouten1980-kd;textual}{tern}. } \keyword{internal}