Releases: openpharma/mmrm
Releases · openpharma/mmrm
v0.3.14
Bug Fixes
- In version 0.3.13, when the tape optimizer from
TMB
was switched on, a warning would be given byfit_mmrm()
, instructing users to turn off the tape optimizer. However, this is not necessary for reproducible results. Instead, it is now checked whether the deterministic hash for theTMB
tape optimizer is used, and a warning is issued otherwise. - In version 0.3.13, the above described warning by
fit_mmrm()
was not visible to the user when callingmmrm()
because it was caught internally, causing the first fit in each session to fail for the first tried optimizer and falling back to the other optimizers. The warning is now issued directly bymmrm()
. This change ensures that the first model fit is consistent regarding the chosen optimizer (and thus numeric results) with subsequent model fits, avoiding discrepancies observed in version 0.3.13.
What's Changed
- 472: fix TMB option warning by @danielinteractive in #473
- add Lukas as contributor, bump up version, polish news by @danielinteractive in #475
Full Changelog: v0.3.13...v0.3.14
v0.3.13
Bug Fixes
- When running with
TMB
package versions below 1.9.15, MMRM fit results are not completely reproducible. While this may not be relevant for most applications, because the numerical differences are very small, we now issue a warning to the user if this is the case. We advise users to upgrade theirTMB
package versions to 1.9.15 or higher to ensure reproducibility. - Previously,
mmrm
ignored contrasts defined for covariates in the input data set. This is fixed now. - Previously,
predict
always required the response to be valid, even for unconditional predictions. This is fixed now and unconditional prediction does not require the response to be valid or present any longer. model.frame
has been updated to ensure that thena.action
works correctly.- Previously
emmeans::emmeans
returnedNA
for spatial covariance structures. This is fixed now. - Previously
car::Anova
gave incorrect results if an interaction term is included and the covariate of interest was not the first categorical variable. This is fixed now. - Previously
car::Anova
failed if the model did not contain an intercept. This is fixed now.
Miscellaneous
- Upon fitting an MMRM, it is checked whether a not reproducible optimization feature of
TMB
is turned on. If so, a warning is issued to the user once per session. mmrm
now checks on the positive definiteness of the covariance matrixtheta_vcov
. If it is not positive definite, non-convergence is messaged appropriately.model.matrix
has been updated to ensure that theNA
values are dropped. Additionally, an argumentuse_response
is added to decide whether records withNA
values in the response should be discarded.predict
has been updated to allow duplicated subject IDs for unconditional prediction.
What's Changed
- fix emmeans on spatial covariance by @clarkliming in #450
- clean up simulations by @clarkliming in #456
- keep contrast using droplevels by @clarkliming in #455
- fix anova type 3 by @clarkliming in #460
- 464: TMB warnings by @danielinteractive in #466
- make unconditional prediction default by @clarkliming in #463
- signal non-convergence if theta_vcov is not positive definite by @danielinteractive in #468
- Create FUNDING.yml by @danielinteractive in #471
- 469 cran by @danielinteractive in #470
Full Changelog: v0.3.12...v0.3.13
v0.3.12
New Features
- Add parameter
conditional
forpredict
method to control whether the prediction is conditional on the observation or not.
Bug Fixes
- Previously if the left hand side of a model formula is an expression,
predict
andsimulate
will fail. This is fixed now.
What's Changed
- add rhub workflow by @danielinteractive in #436
- add conditional arg for predict by @clarkliming in #438
- Adapt missing data sims by @danielinteractive in #443
- docs: Link the coverage badge to the HTML report by @cicdguy in #444
- change email, bump version by @danielinteractive in #447
Full Changelog: v0.3.11...v0.3.12
v0.3.11
Bug Fixes
- Previously if a secondary optimizer fails
mmrm
will fail. This is fixed now. - Previously character covariate variables will make
Anova
fail. This is fixed now.
What's Changed
- fix issue of h_record_all_outputs by @clarkliming in #424
- fix anova error by @clarkliming in #427
- remove biocVer by @clarkliming in #429
- update docs by @clarkliming in #428
- Missing data simulations by @danielinteractive in #430
- fix eigen deprecated warning by @clarkliming in #432
- add tests for residual.R, bump up version by @danielinteractive in #433
Full Changelog: v0.3.10...v0.3.11
v0.3.10
Miscellaneous
- Fix internal test skipping functions for MacOS R.
What's Changed
- 419: make skipping code more general to also run on old R versions by @danielinteractive in #420
Full Changelog: v0.3.8...v0.3.10
v0.3.7
Miscellaneous
- In documentation of
mmrm_control()
, the allowed vcov definition is corrected to "Empirical-Jackknife" (CR3), and "Empirical-Bias-Reduced" (CR2). - Fix a compiler warning related to missing format specification in error message function call.
Full Changelog: v0.3.6...v0.3.7
v0.3.6
New Features
- The argument
method
ofmmrm()
now only specifies the method used for the
degrees of freedom adjustment. - Add empirical, empirical Jackknife and empirical bias-reduced adjusted coefficients
covariance estimates, which can be specified via the newvcov
argument ofmmrm()
. - Add residual and between-within degrees of freedom methods.
- Add Kenward-Roger support for spatial covariance structures.
- Add
model.matrix()
andterms()
methods to assist in post-processing. - Add
predict()
method to obtain conditional mean estimates and prediction intervals. - Add
simulate()
method to simulate observations from the predictive distribution. - Add
residuals()
method to obtain raw, Pearson or normalized residuals. - Add
tidy()
,glance()
andaugment()
methods to tidy the fit results into summary tables. - Add
tidymodels
framework support via aparsnip
interface. - Add argument
covariance
tommrm()
to allow for easier programmatic access
to specifying the model's covariance structure and to expose covariance
customization through thetidymodels
interface.
Bug Fixes
- Previously
mmrm()
follows the global optionna.action
and if it is set
other than"na.omit"
an assertion would fail. This is now fixed and henceNA
values are always removed prior to model fitting, independent of the global
na.action
option. - Previously a
model.frame()
call on anmmrm
object with transformed terms, or new
data, e.g.model.frame(mmrm(Y ~ log(X) + ar1(VISIT|ID), data = new_data)
,
would fail. This is now fixed. - Previously
mmrm()
always required adata
argument. Now fittingmmrm
can also use
environment variables instead of requiringdata
argument. (Note that
fit_mmrm
is not affected.) - Previously
emmeans()
failed when using transformed terms or not including the visit
variable in the model formula. This is now fixed. - Previously
mmrm()
might provide non-finite values in the Jacobian calculations,
leading to errors in the Satterthwaite degrees of freedom calculations. This will raise
an error now and thus alert the user that the model fit was not successful.
Miscellaneous
- Use automatic differentiation to calculate Satterthwaite adjusted degrees of freedom,
resulting in 10-fold speed-up of the Satterthwaite calculations after the initial model fit. - Add an interactive confirmation step if the number of visit levels is too large
for non-spatial covariance structures. Useoptions(mmrm.max_visits = )
to specify the
maximum number of visits allowed in non-interactive mode. - Removed
free_cores()
in favor ofparallelly::availableCores(omit = 1)
. - The
model.frame()
method has been updated: Thefull
argument is deprecated and
theinclude
argument can be used instead; by default all relevant variables are
returned. Furthermore, it returns adata.frame
the size of the number of observations
utilized in the model for all combinations of theinclude
argument
whenna.action= "na.omit"
. - Overall, seven vignettes have been added to the package. All vignettes have a slightly
different look now to reduce the size of the overall R package on CRAN. - The used optimizer is now available via
component(., "optimizer")
instead of previously
attr(., "optimizer")
.
Full Changelog: v0.2.2...v0.3.6
v0.2.2
New Features
- Add support for Kenward-Roger adjusted coefficients covariance matrix and
degrees of freedom inmmrm
function call with argumentmethod
.
Options are "Kenward-Roger", "Kenward-Roger-Linear" and "Satterthwaite"
(which is still the default). Subsequent methods calls
will respect this initial choice, e.g.vcov(fit)
will return the adjusted
coefficients covariance matrix if a Kenward-Roger method has been used. - Update the
mmrm
arguments to allow users more fine-grained control, e.g.
mmrm(..., start = start, optimizer = c("BFGS", "nlminb"))
to set the
starting values for the variance estimates and to choose the available optimizers.
These arguments will be passed to the new functionmmrm_control
. - Add new argument
drop_visit_levels
to allow users to keep all levels in visits,
even when they are not observed in the data. Dropping unobserved levels was done
silently previously, and now a message will be given. See?mmrm_control
for more details.
Bug Fixes
- Previously duplicate time points could be present for a single subject,
and this could lead to segmentation faults if more than the total number of
unique time points were available for any subject. Now it is checked that
there are no duplicate time points per subject, and this is explained also in the
function documentation and the introduction vignette. - Previously in
mmrm
calls, theweights
object in the environment where the
formula is defined was replaced by theweights
used internally.
Now this behavior is removed and your variable
weights
e.g. in the global environment will no longer be replaced.
Miscellaneous
- Deprecated
free_cores()
in favor ofparallelly::availableCores(omit = 1)
. - Deprecated
optimizer = "automatic"
in favor of not specifying theoptimizer
.
By default, all remaining optimizers will be tried if the first optimizer fails
to reach convergence.
Full Changelog: v0.1.5...v0.2.2
v0.1.5
- First version of the package for fitting mixed models for repeated measures
(MMRM) based on Template Model Builder (TMB). - The motivation for this package is to have a fast, reliable (in terms of
convergence behavior) and feature complete implementation of MMRM in R.
New Features
- Currently 9 covariance structures are supported (unstructured, as well as
homogeneous and heterogeneous versions of Toeplitz, auto-regressive order one,
ante-dependence, compound symmetry). - Fast C++ implementation of Maximum Likelihood (ML) and Restricted Maximum
Likelihood (REML) estimation. - Satterthwaite adjusted degrees of freedom calculation.
- Interface to the
emmeans
package for computing estimated marginal means
(also called least-square means) for the coefficients. - Multiple optimizers are run to allow for as much convergence chance as possible.
- Flexible formula based model specification and support for standard S3 methods such
assummary
,logLik
, etc.