Count outcomes with negative multinomial regression imputation models are now supported. Please see the new counts outcomes vignette, as well as the corresponding new statistical specifications for count outcomes vignette, for an introduction. In addition to new S3 methods and new arguments for existing functions, the analysis function neg_bin_regression() conducting negative binomial regression analysis, the simulation function simulate_count_data(), as well as the data wrangling function split_time() to support more complex time period patterns, have been added. Controlled count imputation strategies are defined with count_strategy() and collected with get_count_strategies().
draws() has a new outcome argument. By default the outcome type is determined from vars: count outcomes are specified with set_vars(period = , duration = ).
New transform argument is available in analyse() to support transformations that are applied after the pooling of original scale parameters. The corresponding new scale argument in print.pool() and as.data.frame.pool() methods allows to choose the original or transformed scale to look at for the pooled results. Transformations are created with use_transform().
print.pool() now reports the Rubin degrees-of-freedom method for Rubin pooling.
analyse() now collects warnings from any analysis function and reports one summary listing each distinct message and the number of affected imputed datasets, including when running in parallel. Messages are retained in the rbmi_warnings attribute of each affected result in $results. This avoids repeated warnings.
Bayesian controls now default to init = "auto", preserving the existing model-specific defaults. Count models honour custom Stan initial values and reject explicit init = "mmrm". Draws print the resolved initialisation setting.
Bayesian imputation models now report informative errors naming unidentified model terms when the design matrix is rank deficient among cells with observed outcomes (continuous models) or positive counts (count models).
scalerConstructor previously failed when applied to a matrix instead of a data.frame. This is fixed now.
Previously, ordered or custom-coded treatment factors were incorrectly imputed under reference-based imputation. This is fixed now.
method_bayes(covariance = "cs") and method_bayes(covariance = "csh") now allow negative correlations down to -1 / (n_visits - 1). Previously, integer division in the Stan models restricted the correlation to be non-negative for three or more visits, so draws() failed whenever the MMRM estimate was negative. (#610)
draws() now reports an informative error when Stan fails to start sampling, instead of failing later with "second argument must be a list". (#610)
With method_bayes(same_cov = FALSE) and a structured covariance ("ad", "adh", "ar1", "ar1h", "cs", "csh", "toep", "toeph"), the group-specific prior parameters were assigned in alphabetical order of the treatment groups instead of the order of the factor levels. If the levels were not in alphabetical order (e.g. c("PBO", "ACT")), each group's covariance prior was centred on another group's MMRM estimate. This biased the posterior covariance and therefore the imputations, most strongly for small groups with different variances. Results of such analyses differ from previous versions. (#609)
With control_bayes(init = "mmrm"), the default for a single chain, only the regression coefficients previously started at the MMRM estimates: the covariance parameters were passed to Stan in the wrong names and shapes, so rstan silently started them at random values. All parameters of every covariance structure now start at the MMRM estimates. As a consequence, results of method_bayes() with init = "mmrm" differ from previous versions for the same seed, within Monte Carlo error. (#609)
control_bayes() now warns when init = "mmrm" is combined with more than one chain, as all chains then start at the same values, which makes convergence diagnostics such as R-hat less reliable. (#609)
method_bayes() with the "ad", "adh", "toep" or "toeph" covariance structure failed for data with only two visits, because the correlation prior parameters reached Stan in the wrong shape. This is fixed now. (#613)
vignette("FAQ", package = "rbmi") (#588).pool() gains a rubin_df_method argument. The default "barnard-rubin" uses the
Barnard-Rubin small-sample degrees-of-freedom adjustment, while "rubin"
uses the original approximation from Rubin (1987). (#587)ancova() now supports the analysis of two or more treatment groups. For more than two
groups the ref / alt naming scheme is extended with alt2, alt3, etc. based on the
factor levels of vars$group; the two-group output is unchanged (trt, lsm_ref,
lsm_alt) for backwards compatibility. set_vars() gained a group_contrasts argument
allowing users to specify a bespoke set of treatment-group contrasts for ancova(). By
default a contrast of each non-reference group versus the reference group is estimated.
Custom contrasts must be named (the name becomes the output parameter name) and may be
given as pairwise c(minuend, subtrahend) character vectors or as general named numeric
weight vectors over the group levels (e.g. c(Placebo = -1, A = 0.5, B = 0.5) for a
pooled comparison); contrasts are evaluated in a contrast-coding-agnostic way. The
data.frame produced by as.data.frame() / pool() now includes explicit
estimate_type, group, group_level_1, group_level_2, contrast_label and visit
columns when the analysis was performed with ancova(). The existing parameter column
is retained for backwards compatibility. (#520)ancova() now rejects interactions involving the treatment group in
vars$covariates, avoiding treatment contrasts that depend on the reference
values of interacting covariates. (#595)lifecycle package@return) of all exported functions and marked
internal helpers with @keywords internal (#567).@examples to the exported user-facing functions that were
missing them, and marked the internal-only has_class(), validate() and
longDataConstructor with @keywords internal (#570).MNAR (rather than a mix of NMAR and MNAR)nmar.rm argument of longdata$get_data in favour of mnar.rm
for nomenclature consistency.imputation_list_single() where a failure of
the imputation-count-divisible-by-D check incorrectly reported that "multiple
ids were detected" (#574)mu$visit in simulate_test_data() to refer to
visit instead of trt (#578)apply_delta() to correctly refer to data
instead of dat (#576)README.md (#548)structure() special name .Dim with dim in unit tests
to resolve an R CMD check NOTE (#581)control_bayes() in the quickstart vignettemethod_bayes() gained additional covariance and prior_cov arguments to allow users to specify the covariance structure and prior for the Bayesian imputation model. Please see the updated statistical specifications vignette for details. (#501, #518)mcse() to calculate the Monte Carlo standard error for pooled estimates from (approximate) Bayesian imputation. (#493)burn_in and burn_between arguments in method_bayes() in favour of using the warmup and thin arguments, respectively, in the new control list produced by control_bayes. This is to align with the rstan package. (#477)control_bayes() function to allow expert users to specify additional control arguments for the MCMC computations using rstan. (#477)lsmeans(.weights = "proportional_em") would error if there was only a single categorical variable in the dataset. (#412)|> and lambda functions \(x) from code base to ensure package is backwards compatible with older versions of R. (#474)rstan model were not being correctly cleared (#459)rstan to be a suggested package to simplify the installation process. This means that the Bayesian imputation functionality will not be available by default. To use this feature, you will need to install rstan separately (#441)seed argument to method_bayes() in favour of using the base set.seed() function (#431)rbmi (#406)lsmeans() for better consistency with the emmeans package (#412)
lsmeans(..., weights = "proportional") to lsmeans(..., weights = "counterfactual")to more accurately reflect the weights used in the calculation.lsmeans(..., weights = "proportional_em") which provides consistent results with emmeans(..., weights = "proportional")lsmeans(..., weights = "proportional") has been left in the package for backwards compatibility and is an alias for lsmeans(..., weights = "counterfactual") but now gives
a message prompting users to use either "proportional_em" or "counterfactual" instead.analyse() function (#370)rstan (#288)mmrm package (#437)rbmi citation detail (#423 #425)impute() (#408)pkgdown website (#433)rbmi depends on|> in testing code so package is backwards compatible with older serversglmmTMB dependency with the mmrm package. This has resulted in the package being more stable (less model fitting convergence issues) as well as speeding up run times 3-fold.delta_template()draws()simulate_data()