mmrm 0.3.15.9001
Additions
-
Anova.mmrm()now has atest.statisticargument allowing the user to choose a Chi-squared test as opposed to the default F-test. -
logLik.mmrm_tmb()now includes anobsattribute containing the number of subjects in the inputted model (i.e.,component(mmrm_object, "n_subjects")). As a result,BIC(logLik(mmrm_object))will now be successfully calculated. -
mmrm_control()now has adisable_theta_vcovargument allowing the user to disable computation of the variance-covariance matrix of the covariance parameters. In that case, thenlminboptimizer cannot be used and other optimizers should be selected. Avoiding this computation can be useful in cases where the number of covariance parameters is large and computation of this very large matrix is slow and memory-intensive.
Bug Fixes
- Previously, the compound symmetry correlation models (
csandcsh) could have divergence issues, especially when the correlation was negative. This was because the range of the correlation parameter was from -1 to 1, whereas the correct range is between -1/(m-1) and 1, where m is the number of observations per subject. This is fixed now by using another mapping from the real line to the correct range, and therefore compound symmetry correlation models will work more robustly. - Previously, the
predict()method failed when requesting an unconditional prediction interval. This is fixed now. - Previously, the
emp_start()starting values could only work with variables included directly indata. Now they can also work when variables are not included indatabut are available in the parent environment: The variables will be correctly included in the design matrix. This is achieved by an internal update toh_mmrm_tmb_data(). - Previously, the
vcov()method returned the asymptotic covariance matrix, even if an adjusted one has been used. This is now fixed and the requested adjusted covariance matrix will be returned. (Please note this was not an issue for downstreamsummary()oremmeans()calls, where the adjusted covariance matrix was correctly used.) - Previously, the naming conventions used in the
Anova.mmrm()method were not recognized bybroom::tidy(). This is fixed now by using more standard names for the resulting data frame columns (e.g.Finstead ofF Statisticetc.)
mmrm 0.3.15
CRAN release: 2025-06-10
New Features
-
mmrmnow returns score per subject in empirical covariance. It can be accessed bycomponent(obj, name = "score_per_subject").
Bug Fixes
- Previously, when fitting a model with empirical covariance matrix estimation to a data set with a large number of subjects and/or a large number of coefficients, the model fitting could take very long and exhaust the memory in the worst case. This was due to an inefficient implementation of a matrix needed only in case of Satterthwaite degrees of freedom adjustment. This is fixed now, by returning the matrix
empirical_g_matin themmrmobject, instead of the previousempirical_df_matmatrix. The model fit is now much faster and does not exhaust the memory anymore. If old model fit objects are used, theempirical_df_matwill still be used correctly, however a deprecation warning will be issued. Please consider re-fitting the model to get the newempirical_g_matmatrix. - Previously, when compiling
mmrmfrom source using aTMBversion below 1.9.15, and installing a newerTMBof version 1.9.15 or above, would render themmrmpackage unusable. This is fixed now, by checking in the dynamic library ofmmrmwhether the version ofTMBhas been sufficient.
mmrm 0.3.14
CRAN release: 2024-09-27
Bug Fixes
- In version 0.3.13, when the tape optimizer from
TMBwas 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 theTMBtape 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.
mmrm 0.3.13
CRAN release: 2024-09-23
Bug Fixes
- When running with
TMBpackage 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 theirTMBpackage versions to 1.9.15 or higher to ensure reproducibility. - Previously,
mmrmignored contrasts defined for covariates in the input data set. This is fixed now. - Previously,
predictalways 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.framehas been updated to ensure that thena.actionworks correctly. - Previously
emmeans::emmeansreturnedNAfor spatial covariance structures. This is fixed now. - Previously
car::Anovagave 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::Anovafailed 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
TMBis turned on. If so, a warning is issued to the user once per session. -
mmrmnow checks on the positive definiteness of the covariance matrixtheta_vcov. If it is not positive definite, non-convergence is messaged appropriately. -
model.matrixhas been updated to ensure that theNAvalues are dropped. Additionally, an argumentuse_responseis added to decide whether records withNAvalues in the response should be discarded. -
predicthas been updated to allow duplicated subject IDs for unconditional prediction.
mmrm 0.3.12
CRAN release: 2024-06-26
mmrm 0.3.8
CRAN release: 2024-01-24
New Features
-
Anovais implemented formmrmmodels and available upon loading thecarpackage. It supports type II and III hypothesis testing. - The argument
startformmrm_control()is updated to allow better choices of initial values. -
confintonmmrmmodels will give t-based confidence intervals now, instead of the normal approximation.
Bug Fixes
- Previously if the first optimizer failed, the best successful fit among the remaining optimizers was not returned correctly. This is fixed now.
Miscellaneous
- In documentation of
mmrm_control(), the allowedvcovdefinition is corrected to “Empirical-Jackknife” (CR3), and “Empirical-Bias-Reduced” (CR2). - Fixed a compiler warning related to missing format specification.
- If an empty contrast matrix is provided to
df_md, it will return statistics withNAvalues.
mmrm 0.3.7
CRAN release: 2023-12-08
New Features
- The argument
methodofmmrm()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 new
vcovargument 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
tidymodelsframework support via aparsnipinterface. - Add argument
covariancetommrm()to allow for easier programmatic access to specifying the model’s covariance structure and to expose covariance customization through thetidymodelsinterface.
Bug Fixes
- Previously
mmrm()follows the global optionna.actionand if it is set other than"na.omit"an assertion would fail. This is now fixed and henceNAvalues are always removed prior to model fitting, independent of the globalna.actionoption. - Previously a
model.frame()call on anmmrmobject 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 adataargument. Now fittingmmrmcan also use environment variables instead of requiringdataargument. (Note thatfit_mmrmis 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. Use
options(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: Thefullargument is deprecated and theincludeargument can be used instead; by default all relevant variables are returned. Furthermore, it returns adata.framethe size of the number of observations utilized in the model for all combinations of theincludeargument 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 previouslyattr(., "optimizer").
mmrm 0.2.2
CRAN release: 2022-12-20
New Features
- Add support for Kenward-Roger adjusted coefficients covariance matrix and degrees of freedom in
mmrmfunction 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
mmrmarguments 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_levelsto 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_controlfor 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
mmrmcalls, theweightsobject in the environment where the formula is defined was replaced by theweightsused internally. Now this behavior is removed and your variableweightse.g. in the global environment will no longer be replaced.
mmrm 0.1.5
CRAN release: 2022-10-18
- First CRAN version of the package.
- The package fits mixed models for repeated measures (MMRM) based on the marginal linear model without random effects.
- 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 10 covariance structures are supported (unstructured; as well as homogeneous and heterogeneous versions of Toeplitz, auto-regressive order one, ante-dependence, compound symmetry; and spatial exponential).
- Fast C++ implementation of Maximum Likelihood (ML) and Restricted Maximum Likelihood (REML) estimation.
- Currently Satterthwaite adjusted degrees of freedom calculation is supported.
- Interface to the
emmeanspackage for computing estimated marginal means (also called least-square means) for the coefficients. - Multiple optimizers are run to reach convergence in as many cases as possible.
- Flexible formula based model specification and support for standard S3 methods such as
summary,logLik, etc.