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

Release v1.3.1 #464

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Package: rbmi
Title: Reference Based Multiple Imputation
Version: 1.3.0.9000
Version: 1.3.1
Authors@R: c(
person("Craig", "Gower-Page", email = "[email protected]", role = c("aut", "cre")),
person("Alessandro", "Noci", email = "[email protected]", role = c("aut")),
person("Marcel", "Wolbers", email = "[email protected]", role = "ctb"),
person("Isaac", "Gravestock", email = "[email protected]", role = "aut"),
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd"))
)
Description: Implements standard and reference based multiple imputation methods for continuous
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@ importFrom(stats,var)
importFrom(stats,vcov)
importFrom(utils,capture.output)
importFrom(utils,relist)
importFrom(utils,sessionInfo)
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# rbmi (development version)
# rbmi 1.3.1

- No new items yet...
* Fixed bug where stale caches of the `rstan` model were not being correctly cleared (#459)

# rbmi 1.3.0

Expand Down
3 changes: 2 additions & 1 deletion R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,11 @@ 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(
sessionInfo(c("rbmi", "rstan", "Rcpp", "RcppEigen", "BH"))[["otherPkgs"]],
sessionInfo(c("rbmi", "rstan", "Rcpp", "RcppEigen"))[["otherPkgs"]],
function(x) x[["Version"]],
character(1L)
)
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions man/rbmi-package.Rd

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

2 changes: 1 addition & 1 deletion vignettes/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ <h1><span class="header-section-number">6</span> Custom imputation strategies</h
<span id="cb6-17"><a href="#cb6-17" tabindex="-1"></a><span class="co">#&gt; pars &lt;- list(mu = mu, sigma = sigma)</span></span>
<span id="cb6-18"><a href="#cb6-18" tabindex="-1"></a><span class="co">#&gt; return(pars)</span></span>
<span id="cb6-19"><a href="#cb6-19" tabindex="-1"></a><span class="co">#&gt; }</span></span>
<span id="cb6-20"><a href="#cb6-20" tabindex="-1"></a><span class="co">#&gt; &lt;bytecode: 0x7fd89cc34720&gt;</span></span>
<span id="cb6-20"><a href="#cb6-20" tabindex="-1"></a><span class="co">#&gt; &lt;bytecode: 0x7fd7e885e158&gt;</span></span>
<span id="cb6-21"><a href="#cb6-21" tabindex="-1"></a><span class="co">#&gt; &lt;environment: namespace:rbmi&gt;</span></span></code></pre></div>
<p>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.
Expand Down
40 changes: 20 additions & 20 deletions vignettes/quickstart.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ <h1><span class="header-section-number">3</span> Draws</h1>
<span id="cb4-57"><a href="#cb4-57" tabindex="-1"></a> <span class="at">method =</span> method,</span>
<span id="cb4-58"><a href="#cb4-58" tabindex="-1"></a> <span class="at">quiet =</span> <span class="cn">TRUE</span></span>
<span id="cb4-59"><a href="#cb4-59" tabindex="-1"></a>)</span>
<span id="cb4-60"><a href="#cb4-60" tabindex="-1"></a><span class="co">#&gt; 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.</span></span>
<span id="cb4-60"><a href="#cb4-60" tabindex="-1"></a><span class="co">#&gt; 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.</span></span>
<span id="cb4-61"><a href="#cb4-61" tabindex="-1"></a><span class="co">#&gt; Running the chains for more iterations may help. See</span></span>
<span id="cb4-62"><a href="#cb4-62" tabindex="-1"></a><span class="co">#&gt; https://mc-stan.org/misc/warnings.html#r-hat</span></span>
<span id="cb4-63"><a href="#cb4-63" tabindex="-1"></a>drawObj</span>
Expand Down Expand Up @@ -697,33 +697,33 @@ <h1><span class="header-section-number">6</span> Pool</h1>
<span id="cb9-20"><a href="#cb9-20" tabindex="-1"></a><span class="co">#&gt; trt_4 -0.092 0.683 -1.439 1.256 0.893 </span></span>
<span id="cb9-21"><a href="#cb9-21" tabindex="-1"></a><span class="co">#&gt; lsm_ref_4 -1.616 0.486 -2.576 -0.656 0.001 </span></span>
<span id="cb9-22"><a href="#cb9-22" tabindex="-1"></a><span class="co">#&gt; lsm_alt_4 -1.708 0.475 -2.645 -0.77 &lt;0.001 </span></span>
<span id="cb9-23"><a href="#cb9-23" tabindex="-1"></a><span class="co">#&gt; trt_5 1.328 0.924 -0.497 3.153 0.153 </span></span>
<span id="cb9-24"><a href="#cb9-24" tabindex="-1"></a><span class="co">#&gt; lsm_ref_5 -4.14 0.66 -5.443 -2.838 &lt;0.001 </span></span>
<span id="cb9-25"><a href="#cb9-25" tabindex="-1"></a><span class="co">#&gt; lsm_alt_5 -2.812 0.646 -4.088 -1.537 &lt;0.001 </span></span>
<span id="cb9-26"><a href="#cb9-26" tabindex="-1"></a><span class="co">#&gt; trt_6 1.939 1 -0.037 3.915 0.054 </span></span>
<span id="cb9-27"><a href="#cb9-27" tabindex="-1"></a><span class="co">#&gt; lsm_ref_6 -6.085 0.718 -7.503 -4.667 &lt;0.001 </span></span>
<span id="cb9-28"><a href="#cb9-28" tabindex="-1"></a><span class="co">#&gt; lsm_alt_6 -4.146 0.699 -5.527 -2.766 &lt;0.001 </span></span>
<span id="cb9-29"><a href="#cb9-29" tabindex="-1"></a><span class="co">#&gt; trt_7 2.136 1.12 -0.078 4.35 0.058 </span></span>
<span id="cb9-30"><a href="#cb9-30" tabindex="-1"></a><span class="co">#&gt; lsm_ref_7 -6.982 0.812 -8.587 -5.377 &lt;0.001 </span></span>
<span id="cb9-31"><a href="#cb9-31" tabindex="-1"></a><span class="co">#&gt; lsm_alt_7 -4.846 0.789 -6.405 -3.287 &lt;0.001 </span></span>
<span id="cb9-23"><a href="#cb9-23" tabindex="-1"></a><span class="co">#&gt; trt_5 1.334 0.926 -0.494 3.162 0.151 </span></span>
<span id="cb9-24"><a href="#cb9-24" tabindex="-1"></a><span class="co">#&gt; lsm_ref_5 -4.151 0.661 -5.457 -2.846 &lt;0.001 </span></span>
<span id="cb9-25"><a href="#cb9-25" tabindex="-1"></a><span class="co">#&gt; lsm_alt_5 -2.817 0.648 -4.097 -1.537 &lt;0.001 </span></span>
<span id="cb9-26"><a href="#cb9-26" tabindex="-1"></a><span class="co">#&gt; trt_6 1.934 1 -0.042 3.91 0.055 </span></span>
<span id="cb9-27"><a href="#cb9-27" tabindex="-1"></a><span class="co">#&gt; lsm_ref_6 -6.088 0.715 -7.501 -4.676 &lt;0.001 </span></span>
<span id="cb9-28"><a href="#cb9-28" tabindex="-1"></a><span class="co">#&gt; lsm_alt_6 -4.155 0.698 -5.533 -2.777 &lt;0.001 </span></span>
<span id="cb9-29"><a href="#cb9-29" tabindex="-1"></a><span class="co">#&gt; trt_7 2.177 1.138 -0.073 4.426 0.058 </span></span>
<span id="cb9-30"><a href="#cb9-30" tabindex="-1"></a><span class="co">#&gt; lsm_ref_7 -7.002 0.827 -8.638 -5.367 &lt;0.001 </span></span>
<span id="cb9-31"><a href="#cb9-31" tabindex="-1"></a><span class="co">#&gt; lsm_alt_7 -4.826 0.783 -6.373 -3.278 &lt;0.001 </span></span>
<span id="cb9-32"><a href="#cb9-32" tabindex="-1"></a><span class="co">#&gt; --------------------------------------------------</span></span></code></pre></div>
<p>The table of values shown in the print message for <code>poolObj</code> can also be extracted using the <code>as.data.frame()</code> function:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" tabindex="-1"></a><span class="fu">as.data.frame</span>(poolObj)</span>
<span id="cb10-2"><a href="#cb10-2" tabindex="-1"></a><span class="co">#&gt; parameter est se lci uci pval</span></span>
<span id="cb10-3"><a href="#cb10-3" tabindex="-1"></a><span class="co">#&gt; 1 trt_4 -0.09180645 0.6826279 -1.43949684 1.2558839 8.931772e-01</span></span>
<span id="cb10-4"><a href="#cb10-4" tabindex="-1"></a><span class="co">#&gt; 2 lsm_ref_4 -1.61581996 0.4862316 -2.57577141 -0.6558685 1.093708e-03</span></span>
<span id="cb10-5"><a href="#cb10-5" tabindex="-1"></a><span class="co">#&gt; 3 lsm_alt_4 -1.70762640 0.4749573 -2.64531931 -0.7699335 4.262148e-04</span></span>
<span id="cb10-6"><a href="#cb10-6" tabindex="-1"></a><span class="co">#&gt; 4 trt_5 1.32800107 0.9239991 -0.49687491 3.1528770 1.526144e-01</span></span>
<span id="cb10-7"><a href="#cb10-7" tabindex="-1"></a><span class="co">#&gt; 5 lsm_ref_5 -4.14031255 0.6595847 -5.44302381 -2.8376013 3.163421e-09</span></span>
<span id="cb10-8"><a href="#cb10-8" tabindex="-1"></a><span class="co">#&gt; 6 lsm_alt_5 -2.81231148 0.6459122 -4.08807336 -1.5365496 2.396574e-05</span></span>
<span id="cb10-9"><a href="#cb10-9" tabindex="-1"></a><span class="co">#&gt; 7 trt_6 1.93891419 1.0001460 -0.03694571 3.9147741 5.438468e-02</span></span>
<span id="cb10-10"><a href="#cb10-10" tabindex="-1"></a><span class="co">#&gt; 8 lsm_ref_6 -6.08530002 0.7176967 -7.50335519 -4.6672448 1.946811e-14</span></span>
<span id="cb10-11"><a href="#cb10-11" tabindex="-1"></a><span class="co">#&gt; 9 lsm_alt_6 -4.14638583 0.6985434 -5.52650481 -2.7662668 1.911219e-08</span></span>
<span id="cb10-12"><a href="#cb10-12" tabindex="-1"></a><span class="co">#&gt; 10 trt_7 2.13609482 1.1201125 -0.07781920 4.3500088 5.849971e-02</span></span>
<span id="cb10-13"><a href="#cb10-13" tabindex="-1"></a><span class="co">#&gt; 11 lsm_ref_7 -6.98181990 0.8117268 -8.58678186 -5.3768579 1.511791e-14</span></span>
<span id="cb10-14"><a href="#cb10-14" tabindex="-1"></a><span class="co">#&gt; 12 lsm_alt_7 -4.84572508 0.7885999 -6.40477980 -3.2866704 7.793320e-09</span></span></code></pre></div>
<span id="cb10-6"><a href="#cb10-6" tabindex="-1"></a><span class="co">#&gt; 4 trt_5 1.33436741 0.9255820 -0.49370018 3.1624350 1.513737e-01</span></span>
<span id="cb10-7"><a href="#cb10-7" tabindex="-1"></a><span class="co">#&gt; 5 lsm_ref_5 -4.15140080 0.6608110 -5.45658456 -2.8462170 3.110832e-09</span></span>
<span id="cb10-8"><a href="#cb10-8" tabindex="-1"></a><span class="co">#&gt; 6 lsm_alt_5 -2.81703340 0.6478134 -4.09662455 -1.5374422 2.460646e-05</span></span>
<span id="cb10-9"><a href="#cb10-9" tabindex="-1"></a><span class="co">#&gt; 7 trt_6 1.93372720 1.0000881 -0.04213496 3.9095894 5.502527e-02</span></span>
<span id="cb10-10"><a href="#cb10-10" tabindex="-1"></a><span class="co">#&gt; 8 lsm_ref_6 -6.08849645 0.7148756 -7.50096014 -4.6760328 1.548722e-14</span></span>
<span id="cb10-11"><a href="#cb10-11" tabindex="-1"></a><span class="co">#&gt; 9 lsm_alt_6 -4.15476925 0.6975559 -5.53298494 -2.7765536 1.739819e-08</span></span>
<span id="cb10-12"><a href="#cb10-12" tabindex="-1"></a><span class="co">#&gt; 10 trt_7 2.17651184 1.1379189 -0.07335404 4.4263777 5.784145e-02</span></span>
<span id="cb10-13"><a href="#cb10-13" tabindex="-1"></a><span class="co">#&gt; 11 lsm_ref_7 -7.00205125 0.8268086 -8.63751537 -5.3665871 4.132364e-14</span></span>
<span id="cb10-14"><a href="#cb10-14" tabindex="-1"></a><span class="co">#&gt; 12 lsm_alt_7 -4.82553941 0.7830124 -6.37333317 -3.2777456 6.903910e-09</span></span></code></pre></div>
<p>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.</p>
</div>
<div id="code" class="section level1" number="7">
Expand Down
Loading