sat-modcomp {pbkrtest} | R Documentation |
An approximate F-test based on the Satterthwaite approach.
SATmodcomp(
largeModel,
smallModel,
details = 0,
eps = sqrt(.Machine$double.eps)
)
## S3 method for class 'lmerMod'
SATmodcomp(
largeModel,
smallModel,
details = 0,
eps = sqrt(.Machine$double.eps)
)
largeModel |
An |
smallModel |
An |
details |
If larger than 0 some timing details are printed. |
eps |
A small number. |
Notice: It cannot be guaranteed that the results agree with other implementations of the Satterthwaite approach!
This code is greatly inspired by code in the lmerTest package. This is a recent addition to the pbkrtest package; please report unexpected behaviour.
Søren Højsgaard, sorenh@math.aau.dk
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, 58(10), 1-30., https://www.jstatsoft.org/v59/i09/
getKR
, lmer
, vcovAdj
,
PBmodcomp
(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
L1 <- cbind(0,1)
SATmodcomp(fm1, L1)
(fm2 <- lmer(Reaction ~ Days + I(Days^2) + (Days|Subject), sleepstudy))
## Test for no effect of Days. There are three ways of using the function:
## 1) Define 2-df contrast - since L has 2 (linearly independent) rows
## the F-test is on 2 (numerator) df:
L2 <- rbind(c(0, 1, 0), c(0, 0, 1))
SATmodcomp(fm2, L2)
## 2) Use two model objects
fm3 <- update(fm2, ~. - Days - I(Days^2))
SATmodcomp(fm2, fm3)
## 3) Specify restriction as formula
SATmodcomp(fm2, ~. - Days - I(Days^2))