JuliaCon 2025

MixedModelsSmallSample.jl inference adjustments
2025-07-24 , Main Room 3

MixedModelsSmallSample.jl makes small sample adjustments to the hypothesis tests and confidence intervals of mixed effect regression models estimated by restricted maximum likelihood using MixedModels.jl.


Mixed effect regression models are statistical models that not only contain fixed effects but also random effects. Fixed effects are non-random quantities, while random effects are random variables. Both of these effects must be estimated from data. A popular method for estimating mixed models is restricted maximum likelihood (REML).

Julia already has a state-of-the-art package, MixedModels.jl, for estimating these effects using REML.
Inference for the effects is, however, based on large sample approximations or on bootstrapping.

When working with a small sample, the asymptotic approximation might not hold, and the resampling in the bootstrapping procedure might make the model inestimable.

Alternative small sample inference approaches have been suggested by Kenward and Roger [1] and by Fai and Cornelius [2]. In these methods, the asymptotic results for confidence intervals and hypothesis tests are adjusted to account for finite sample sizes. MixedModelsSmallSample.jl implements these small sample adjustments for models estimated by MixedModels.jl.

These adjustment methods have already been incorporated in many statistical software programs, such as SAS, JMP and lmerTest [3-5]. These packages, however, differ in some statistical details. For example, SAS and JMP use the observed Fisher information matrix for variance components, while lmerTest uses the expected Fisher information matrix. MixedModelsSmallSample.jl provides user options to configure these technical details, such that results from SAS, JMP and lmerTest can be exactly reproduced and easily compared.

The documentation of MixedModelsSmallSample.jl can be found on:
https://arnostrouwen.github.io/MixedModelsSmallSample.jl/dev/

References:
[1]: Kenward, Michael G., and James H. Roger. "Small sample inference for fixed effects from restricted maximum likelihood." Biometrics (1997): 983-997.
[2]: Hrong-Tai Fai, Alex, and Paul L. Cornelius. "Approximate F-tests of multiple degree of freedom hypotheses in generalized least squares analyses of unbalanced split-plot experiments." Journal of statistical computation and simulation 54.4 (1996): 363-378.
[3]: SAS Institute Inc. 2015. SAS/STAT® 14.1 User’s Guide: The MIXED Procedure. Cary, NC: SAS Institute Inc
[4]: JMP Statistical Discovery LLC 2024. JMP ® 18 Fitting Linear Models. Cary, NC: JMP Statistical Discovery LLC
[5]: Kuznetsova, Alexandra, Per B. Brockhoff, and Rune HB Christensen. "lmerTest package: tests in linear mixed effects models." Journal of statistical software 82 (2017): 1-26.

Research Scientist at JuliaHub.
Interested in optimal data gathering strategies for SciML applications.

This speaker also appears in: