Movatterモバイル変換
[0]ホーム
mmrm 0.3.16
New Features
Anova.mmrm() now has atest.statisticargument allowing the user to choose the Chi-squared test as opposed tothe default F-test.mmrm_control() now has adisable_theta_vcov argument allowing the user to disablecomputation of the variance-covariance matrix of the covarianceparameters. In that case, thenlminb optimizer cannot beused and other optimizers should be selected. Avoiding this computationcan be useful in cases where the number of covariance parameters islarge and computation of this very large matrix is slow andmemory-intensive.model.frame() has a new argumentexcludewhich allows to exclude specific model variables from the returned dataframe,after creating the initialmodel.frame.This is useful when the same rows should be kept as in the originalmodel fit (e.g. afterna.action has been applied), but somevariables are not needed in the returned data frame. Theterms attribute of the returned data frame is updatedaccordingly.
Bug Fixes
- Previously, the compound symmetry correlation models(
cs andcsh) could have divergence issues,especially when the correlation was negative. This was because the rangeof the correlation parameter was from -1 to 1, whereas the correct rangeis between -1/(m-1) and 1, where m is the number of observations persubject. This is fixed now by using another mapping from the real lineto the correct range, and therefore compound symmetry correlation modelswill work more robustly. - Previously, the
predict() method failed when requestingan unconditional prediction interval. This is fixed now. - Previously, the
emp_start() starting values could onlywork with variables included directly indata. Now they canalso work when variables are not included indata but areavailable in the parent environment: The variables will be correctlyincluded in the design matrix. This is achieved by an internal update toh_mmrm_tmb_data(). - Previously, the
model.frame() method failed when themodel formula included variables from the environment. This is fixednow. In addition, whereasmodel.frame() used to applyna.action before processing theincludeargument,na.action is now applied afterwards. As a result,any variables excluded frominclude are no longerconsidered whenna.action is applied. Therefore, in thedefault case whenna.action = "na.omit", this can lead tomore rows being kept in the returned data frame compared to previousversions. - Previously, the
model.frame() method did not pass onadditional arguments to themodel.frame.default() method,e.g. subset. This is fixed now. - Previously, the
vcov() method returned the asymptoticcovariance matrix, even if an adjusted one has been used. This is nowfixed and the requested adjusted covariance matrix will be returned.(Please note this was not an issue for downstreamsummary()oremmeans() calls, where the adjusted covariance matrixwas correctly used.) - Previously, type 3 tests in the
Anova.mmrm() methodcould give incorrect results which were not compatible with results fromlme4::lmer() or other software (e.g. when using other thantreatment contrasts). This is fixed now. In particular, any combinationof contrasts can be used and will yield consistent results. Anova.mmrm() can now handle intercept-free models intype 2 tests, even when the first effect containing a categoricalvariable has an aliased parameter.- Previously, the naming conventions used in the
Anova.mmrm() method were not recognized bybroom::tidy(). This is fixed now by using more standardnames for the resulting data frame columns (e.g. F insteadofF Statistic etc.) logLik.mmrm_tmb() now includes annobsattribute containing the number of subjects in the provided model (i.e.,component(mmrm_object, "n_subjects")). As a result,BIC(logLik(mmrm_object)) can now be successfullycalculated.
mmrm 0.3.15
New Features
mmrm now returns score per subject in empiricalcovariance. It can be accessed bycomponent(obj, name = "score_per_subject").
Bug Fixes
- Previously, when fitting a model with empirical covariance matrixestimation to a data set with a large number of subjects and/or a largenumber of coefficients, the model fitting could take very long andexhaust the memory in the worst case. This was due to an inefficientimplementation of a matrix needed only in case of Satterthwaite degreesof freedom adjustment. This is fixed now, by returning the matrix
empirical_g_mat in themmrm object, instead ofthe previousempirical_df_mat matrix. The model fit is nowmuch faster and does not exhaust the memory anymore. If old model fitobjects are used, theempirical_df_mat will still be usedcorrectly, however a deprecation warning will be issued. Please considerre-fitting the model to get the newempirical_g_matmatrix. - Previously, when compiling
mmrm from source using aTMB version below 1.9.15, and installing a newerTMB of version 1.9.15 or above, would render themmrm package unusable. This is fixed now, by checking inthe dynamic library ofmmrm whether the version ofTMB has been sufficient.
mmrm 0.3.14
Bug Fixes
- In version 0.3.13, when the tape optimizer from
TMB wasswitched on, a warning would be given byfit_mmrm(),instructing users to turn off the tape optimizer. However, this is notnecessary for reproducible results. Instead, it is now checked whetherthe 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 firstfit in each session to fail for the first tried optimizer and fallingback to the other optimizers. The warning is now issued directly bymmrm(). This change ensures that the first model fit isconsistent regarding the chosen optimizer (and thus numeric results)with subsequent model fits, avoiding discrepancies observed in version0.3.13.
mmrm 0.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 berelevant for most applications, because the numerical differences arevery small, we now issue a warning to the user if this is the case. Weadvise users to upgrade theirTMB package versions to1.9.15 or higher to ensure reproducibility. - Previously,
mmrm ignored contrasts defined forcovariates in the input data set. This is fixed now. - Previously,
predict always required the response to bevalid, even for unconditional predictions. This is fixed now andunconditional prediction does not require the response to be valid orpresent any longer. model.frame has been updated to ensure that thena.action works correctly.- Previously
emmeans::emmeans returnedNAfor spatial covariance structures. This is fixed now. - Previously
car::Anova gave incorrect results if aninteraction term is included and the covariate of interest was not thefirst categorical variable. This is fixed now. - Previously
car::Anova failed if the model did notcontain an intercept. This is fixed now.
Miscellaneous
- Upon fitting an MMRM, it is checked whether a not reproducibleoptimization feature of
TMB is turned on. If so, a warningis issued to the user once per session. mmrm now checks on the positive definiteness of thecovariance matrixtheta_vcov. If it is not positivedefinite, 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 subjectIDs for unconditional prediction.
mmrm 0.3.12
New Features
- Add parameter
conditional forpredictmethod to control whether the prediction is conditional on theobservation or not.
Bug Fixes
- Previously if the left hand side of a model formula is anexpression,
predict andsimulate will fail.This is fixed now.
mmrm 0.3.11
Bug Fixes
- Previously if a secondary optimizer fails
mmrm willfail. This is fixed now. - Previously character covariate variables will make
Anova fail. This is fixed now.
mmrm 0.3.10
Miscellaneous
- Fix internal test skipping functions for MacOS R.
mmrm 0.3.9
Miscellaneous
- Fix internal test skipping functions for R versions older than4.3.
mmrm 0.3.8
New Features
Anova is implemented formmrm models andavailable upon loading thecar package. It supports type IIand III hypothesis testing.- The argument
start formmrm_control() isupdated to allow better choices of initial values. confint onmmrm models will give t-basedconfidence intervals now, instead of the normal approximation.
Bug Fixes
- Previously if the first optimizer failed, the best successful fitamong the remaining optimizers was not returned correctly. This is fixednow.
Miscellaneous
- In documentation of
mmrm_control(), the allowedvcov definition is corrected to “Empirical-Jackknife”(CR3), and “Empirical-Bias-Reduced” (CR2). - Fixed a compiler warning related to missing formatspecification.
- If an empty contrast matrix is provided to
df_md, itwill return statistics withNA values.
mmrm 0.3.7
New Features
- The argument
method ofmmrm() now onlyspecifies the method used for the degrees of freedom adjustment. - Add empirical, empirical Jackknife and empirical bias-reducedadjusted coefficients covariance estimates, which can be specified viathe new
vcov argument ofmmrm(). - Add residual and between-within degrees of freedom methods.
- Add Kenward-Roger support for spatial covariance structures.
- Add
model.matrix() andterms() methods toassist in post-processing. - Add
predict() method to obtain conditional meanestimates and prediction intervals. - Add
simulate() method to simulate observations from thepredictive distribution. - Add
residuals() method to obtain raw, Pearson ornormalized residuals. - Add
tidy(),glance() andaugment() methods to tidy the fit results into summarytables. - Add
tidymodels framework support via aparsnip interface. - Add argument
covariance tommrm() to allowfor easier programmatic access to specifying the model’s covariancestructure 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 andhenceNA values are always removed prior to model fitting,independent of the globalna.action option. - 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 fittingmmrm can also use environmentvariables instead of requiringdata argument. (Note thatfit_mmrm is not affected.) - Previously
emmeans() failed when using transformedterms or not including the visit variable in the model formula. This isnow fixed. - Previously
mmrm() might provide non-finite values inthe Jacobian calculations, leading to errors in the Satterthwaitedegrees of freedom calculations. This will raise an error now and thusalert the user that the model fit was not successful.
Miscellaneous
- Use automatic differentiation to calculate Satterthwaite adjusteddegrees of freedom, resulting in 10-fold speed-up of the Satterthwaitecalculations after the initial model fit.
- Add an interactive confirmation step if the number of visit levelsis too large for non-spatial covariance structures. Use
options(mmrm.max_visits = ) to specify the maximum numberof 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 theincludeargument can be used instead; by default all relevant variables arereturned. Furthermore, it returns adata.frame the size ofthe number of observations utilized in the model for all combinations oftheinclude argument whenna.action= "na.omit". - Overall, seven vignettes have been added to the package. Allvignettes have a slightly different look now to reduce the size of theoverall R package on CRAN.
- The used optimizer is now available via
component(., "optimizer") instead of previouslyattr(., "optimizer").
mmrm 0.2.2
New Features
- Add support for Kenward-Roger adjusted coefficients covariancematrix and degrees of freedom in
mmrm function call withargumentmethod. 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 coefficientscovariance matrix if a Kenward-Roger method has been used. - Update the
mmrm arguments to allow users morefine-grained control, e.g.mmrm(..., start = start, optimizer = c("BFGS", "nlminb"))to set the starting values for the variance estimates and to choose theavailable optimizers. These arguments will be passed to the new functionmmrm_control. - Add new argument
drop_visit_levels to allow users tokeep all levels in visits, even when they are not observed in the data.Dropping unobserved levels was done silently previously, and now amessage will be given. See?mmrm_control for moredetails.
Bug Fixes
- Previously duplicate time points could be present for a singlesubject, and this could lead to segmentation faults if more than thetotal number of unique time points were available for any subject. Nowit is checked that there are no duplicate time points per subject, andthis is explained also in the function documentation and theintroduction vignette.
- Previously in
mmrm calls, theweightsobject in the environment where the formula is defined was replaced bytheweights used internally. Now this behavior is removedand your variableweights e.g. in the global environmentwill no longer be replaced.
Miscellaneous
- Deprecated
free_cores() in favor ofparallelly::availableCores(omit = 1). - Deprecated
optimizer = "automatic" in favor of notspecifying theoptimizer. By default, all remainingoptimizers will be tried if the first optimizer fails to reachconvergence.
mmrm 0.1.5
- First CRAN version of the package.
- The package fits mixed models for repeated measures (MMRM) based onthe marginal linear model without random effects.
- The motivation for this package is to have a fast, reliable (interms of convergence behavior) and feature complete implementation ofMMRM in R.
New Features
- Currently 10 covariance structures are supported (unstructured; aswell as homogeneous and heterogeneous versions of Toeplitz,auto-regressive order one, ante-dependence, compound symmetry; andspatial exponential).
- Fast C++ implementation of Maximum Likelihood (ML) and RestrictedMaximum Likelihood (REML) estimation.
- Currently Satterthwaite adjusted degrees of freedom calculation issupported.
- Interface to the
emmeans package for computingestimated marginal means (also called least-square means) for thecoefficients. - Multiple optimizers are run to reach convergence in as many cases aspossible.
- Flexible formula based model specification and support for standardS3 methods such as
summary,logLik, etc.
[8]ページ先頭