merTools is an R package that is designed to make working with multilevel models from lme4, particularly large models with many random effects, fast and easy. With merTools you can generate prediction intervals that incorporate various components of uncertainty (fixed effect, random effect, and model uncertainty), you can get the expected rank of individual random effect levels (a combination of magnitude and precision of the estimate) and you can explore the substantive effect of variables in the model using a Shiny application interactively!
Recently, we’ve updated the package to significantly improve performance and accuracy. You can get it on CRAN now.
- Improve handling of formulas. If the original
merModhas functions specified in the formula, the
wigglefunctions will check for this and attempt to respect these variable transformations. Where this is not possible a warning will be issued. Most common transformations are respected as long as the the original variable is passed untransformed to the model.
- Change the calculations of the residual variance. Previously residual variance was used to inflate both the variance around the fixed parameters and around the predicted values themselves. This was incorrect and resulted in overly conservative estimates. Now the residual variance is appropriately only used around the final predictions
- New option for
predictIntervalthat allows the user to return the full interval, the fixed component, the random component, or the fixed and each random component separately for each observation
- Fixed a bug with slope+intercept random terms that caused a miscalculation of the random component
- Add comparison to
rstanarmto the Vignette
tidylike and allow function to calculate expected rank for all terms at once
- Note, this breaks the API by changing the names of the columns in the output of this function
- Remove tests that test for timing to avoid issues with R-devel JIT compiler
plyrand replace with
- Fix issue #62
varListwill now throw an error if
==is used instead of
- Fix issue #54
predictIntervaldid not included random effects in calculations when
newdatahad more than 1000 rows and/or user specified
parallel=TRUE. Note: fix was to disable the
predictInterval… user can still specify for temporary backward compatibility but this should be either removed or fixed in the permanent solution.
- Fix issue #53 about problems with
predictIntervalwhen only specific levels of a grouping factor are in
newdatawith the colon specification of interactions
- Fix issue #52 ICC wrong calculations … we just needed to square the standard deviations that we pulled