pbkrtest - at a glance

The primary focus is on mixed effects models as implemented in the lme4 package. For those linear mixed models, the pbkrtest package implements

  • Kenward-Roger based F-tests

  • Parametric bootstrap based test

  • Satterthwaite based F-tests (! NEW !)

In addition, pbkrtest also implments parametric bootstrap tests for generalized linear mixed models, for generalized linear models and for linear models.

Citing the package

If you publish work where pbkrtest, please do cite this paper (a latex entry is given below): Halekoh, U., and Højsgaard, S. (2014) A Kenward-Roger Approximation and Parametric Bootstrap Methods for Tests in Linear Mixed Models - the R Package pbkrtest. J. Stat. Soft. Vol. 59, Issue 9. pdf


  • Summer 2020: Satterthwaites method for computing denominator degrees of freedom has been implemented. Is in github version of package now - in experimental form.

  • Summer 2020: Kenward-Roger approximation for nlme and gls models has been contributed. Is not in package yet.

Examples and vignettes


  • 2020: Inferens i mixed models i R - hinsides det sædvanlige likelihood ratio test. 42. Symposium i Anvendt Statistik, 27.-28. January, Aarhus, Denmark pdf

  • 2018: Inference in mixed models in R - beyond the usual asymptotic likelihood ratio test. Nordstat conference, Tartu, Estonia, June 2018. pdf

  • Please see my talks page.

Performance issues

Calculation of the the adjusted degrees of freedom for the Kenward-Roger approximation can be computationally demanding because it requires inversion of an N ×N matrix where N is the number of observations. Possible remedies for this:

  • On linux (ubuntu), changing the BLAS to ATLAS-BLAS generally provides a speed-up with a factor 3-6 (compared with R’s default BLAS). That helps in some situations.

  • Parametric bootstrap is an alternative, and while also computationally intensive, parametric bootstrap can be parallelized (facilities exist in pbkrtest). href=“http://cran.r-project.org/web/packages/pbkrtest/index.html”>pbkrtest).

  • Use Satterthwaites approximation instead. This method scales better higher dimensional problems.

Development versions

Development versions of the package reside on github. To use the development version, PLEASE first install the package from CRAN to get dependencies right and then AFTERWARDS install the development version using:


FAQ (frequently asked questions)

  • Q: Do these methods work for generalized linear mixed models ?

  • A: Parametric bootstrap is available for generalized linear mixed models. We are not aware of any developments for approximate F-tests in the spirit of Kenward-Roger / Satterthwaite for generalized linear models.

  • Q: Are these models implemented for mixed models fitted with the nlme package?

  • A: Yes and no. Code exists but needs to be integrated with the package.

Reporting unexpected behaviour

When reporting unexpected behaviours, bugs etc. PLEASE supply:

  • A small reproducible example in terms of a short code fragment.

  • The data. The preferred way of sending the data “mydata” is to copy and paste the result from running dput(mydata).

  • The result of running the sessionInfo() function.



To cite pbkrtest in publications use:

  Ulrich Halekoh, Søren Højsgaard (2014). A Kenward-Roger Approximation
  and Parametric Bootstrap Methods for Tests in Linear Mixed Models -
  The R Package pbkrtest. Journal of Statistical Software, 59(9), 1-30.
  URL http://www.jstatsoft.org/v59/i09/.

A BibTeX entry for LaTeX users is

    title = {A Kenward-Roger Approximation and Parametric Bootstrap Methods for Tests in Linear Mixed Models -- The {R} Package {pbkrtest}},
    author = {Ulrich Halekoh and S{\o}ren H{\o}jsgaard},
    journal = {Journal of Statistical Software},
    year = {2014},
    volume = {59},
    number = {9},
    pages = {1--30},
    url = {http://www.jstatsoft.org/v59/i09/},