diff --git a/DESCRIPTION b/DESCRIPTION index e9a9f73ed..7394deefb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,6 +5,7 @@ Authors@R: c( person("Craig", "Gower-Page", email = "craig.gower-page@roche.com", role = c("aut", "cre")), person("Alessandro", "Noci", email = "alessandro.noci@roche.com", role = c("aut")), person("Marcel", "Wolbers", email = "marcel.wolbers@roche.com", role = "ctb"), + person("Isaac", "Gravestock", email = "isaac.gravestock@roche.com", role = "aut"), person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")) ) Description: Implements standard and reference based multiple imputation methods for continuous diff --git a/NAMESPACE b/NAMESPACE index 2d8c204f1..e22d45abb 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -104,3 +104,4 @@ importFrom(stats,var) importFrom(stats,vcov) importFrom(utils,capture.output) importFrom(utils,relist) +importFrom(utils,sessionInfo) diff --git a/R/utilities.R b/R/utilities.R index 87ae84ca5..c06a81ebf 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -535,6 +535,7 @@ ensure_rstan <- function() { #' Get session hash #' #' Gets a unique string based on the current R version and relevant packages. +#' @importFrom utils sessionInfo #' @keywords internal get_session_hash <- function() { pkg_versions <- vapply( diff --git a/cran-comments.md b/cran-comments.md index 7e7d50445..8684eac0d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,6 @@ ## Summary of Submission -This version of the package adds two new vignettes as well as additional parallel processing support. It also includes a number of minor bug fixes and updates to the documentation. +This version of the package fixes an issue that was causing the unit tests to crash on CRAN. The issue was due to the package not correctly clearing out the cache of previously compiled `rstan` models. ## R CMD check results diff --git a/man/rbmi-package.Rd b/man/rbmi-package.Rd index 91889ae1a..b776349eb 100644 --- a/man/rbmi-package.Rd +++ b/man/rbmi-package.Rd @@ -37,6 +37,7 @@ Useful links: Authors: \itemize{ \item Alessandro Noci \email{alessandro.noci@roche.com} + \item Isaac Gravestock \email{isaac.gravestock@roche.com} } Other contributors: diff --git a/vignettes/advanced.html b/vignettes/advanced.html index bed524352..1b92b8feb 100644 --- a/vignettes/advanced.html +++ b/vignettes/advanced.html @@ -714,7 +714,7 @@

6 Custom imputation strategies#> pars <- list(mu = mu, sigma = sigma) #> return(pars) #> } -#> <bytecode: 0x7fd89cc34720> +#> <bytecode: 0x7fd7e885e158> #> <environment: namespace:rbmi>

To further illustrate this for a simple example, assume that a new strategy is to be implemented as follows: - The marginal mean of the imputation distribution is equal to the marginal mean trajectory for the subject according to their assigned group and covariates up to the ICE. diff --git a/vignettes/quickstart.html b/vignettes/quickstart.html index 4012b6b24..228d947c8 100644 --- a/vignettes/quickstart.html +++ b/vignettes/quickstart.html @@ -456,7 +456,7 @@

3 Draws

method = method, quiet = TRUE ) -#> Warning in fit_mcmc(designmat = model_df_scaled[, -1, drop = FALSE], outcome = model_df_scaled[, : The largest R-hat is 1.06, indicating chains have not mixed. +#> Warning in fit_mcmc(designmat = model_df_scaled[, -1, drop = FALSE], outcome = model_df_scaled[, : The largest R-hat is 1.05, indicating chains have not mixed. #> Running the chains for more iterations may help. See #> https://mc-stan.org/misc/warnings.html#r-hat drawObj @@ -697,15 +697,15 @@

6 Pool

#> trt_4 -0.092 0.683 -1.439 1.256 0.893 #> lsm_ref_4 -1.616 0.486 -2.576 -0.656 0.001 #> lsm_alt_4 -1.708 0.475 -2.645 -0.77 <0.001 -#> trt_5 1.328 0.924 -0.497 3.153 0.153 -#> lsm_ref_5 -4.14 0.66 -5.443 -2.838 <0.001 -#> lsm_alt_5 -2.812 0.646 -4.088 -1.537 <0.001 -#> trt_6 1.939 1 -0.037 3.915 0.054 -#> lsm_ref_6 -6.085 0.718 -7.503 -4.667 <0.001 -#> lsm_alt_6 -4.146 0.699 -5.527 -2.766 <0.001 -#> trt_7 2.136 1.12 -0.078 4.35 0.058 -#> lsm_ref_7 -6.982 0.812 -8.587 -5.377 <0.001 -#> lsm_alt_7 -4.846 0.789 -6.405 -3.287 <0.001 +#> trt_5 1.334 0.926 -0.494 3.162 0.151 +#> lsm_ref_5 -4.151 0.661 -5.457 -2.846 <0.001 +#> lsm_alt_5 -2.817 0.648 -4.097 -1.537 <0.001 +#> trt_6 1.934 1 -0.042 3.91 0.055 +#> lsm_ref_6 -6.088 0.715 -7.501 -4.676 <0.001 +#> lsm_alt_6 -4.155 0.698 -5.533 -2.777 <0.001 +#> trt_7 2.177 1.138 -0.073 4.426 0.058 +#> lsm_ref_7 -7.002 0.827 -8.638 -5.367 <0.001 +#> lsm_alt_7 -4.826 0.783 -6.373 -3.278 <0.001 #> --------------------------------------------------

The table of values shown in the print message for poolObj can also be extracted using the as.data.frame() function:

as.data.frame(poolObj)
@@ -713,17 +713,17 @@ 

6 Pool

#> 1 trt_4 -0.09180645 0.6826279 -1.43949684 1.2558839 8.931772e-01 #> 2 lsm_ref_4 -1.61581996 0.4862316 -2.57577141 -0.6558685 1.093708e-03 #> 3 lsm_alt_4 -1.70762640 0.4749573 -2.64531931 -0.7699335 4.262148e-04 -#> 4 trt_5 1.32800107 0.9239991 -0.49687491 3.1528770 1.526144e-01 -#> 5 lsm_ref_5 -4.14031255 0.6595847 -5.44302381 -2.8376013 3.163421e-09 -#> 6 lsm_alt_5 -2.81231148 0.6459122 -4.08807336 -1.5365496 2.396574e-05 -#> 7 trt_6 1.93891419 1.0001460 -0.03694571 3.9147741 5.438468e-02 -#> 8 lsm_ref_6 -6.08530002 0.7176967 -7.50335519 -4.6672448 1.946811e-14 -#> 9 lsm_alt_6 -4.14638583 0.6985434 -5.52650481 -2.7662668 1.911219e-08 -#> 10 trt_7 2.13609482 1.1201125 -0.07781920 4.3500088 5.849971e-02 -#> 11 lsm_ref_7 -6.98181990 0.8117268 -8.58678186 -5.3768579 1.511791e-14 -#> 12 lsm_alt_7 -4.84572508 0.7885999 -6.40477980 -3.2866704 7.793320e-09
+#> 4 trt_5 1.33436741 0.9255820 -0.49370018 3.1624350 1.513737e-01 +#> 5 lsm_ref_5 -4.15140080 0.6608110 -5.45658456 -2.8462170 3.110832e-09 +#> 6 lsm_alt_5 -2.81703340 0.6478134 -4.09662455 -1.5374422 2.460646e-05 +#> 7 trt_6 1.93372720 1.0000881 -0.04213496 3.9095894 5.502527e-02 +#> 8 lsm_ref_6 -6.08849645 0.7148756 -7.50096014 -4.6760328 1.548722e-14 +#> 9 lsm_alt_6 -4.15476925 0.6975559 -5.53298494 -2.7765536 1.739819e-08 +#> 10 trt_7 2.17651184 1.1379189 -0.07335404 4.4263777 5.784145e-02 +#> 11 lsm_ref_7 -7.00205125 0.8268086 -8.63751537 -5.3665871 4.132364e-14 +#> 12 lsm_alt_7 -4.82553941 0.7830124 -6.37333317 -3.2777456 6.903910e-09

These outputs gives an estimated difference of -2.136 (95% CI -0.078 to 4.350) +2.177 (95% CI -0.073 to 4.426) between the two groups at the last visit with an associated p-value of 0.058.