Skip to contents

Kenward & Roger (1997), as written in Schabenberger & Gotway (2005) eqs (6.53)-(6.54): with Phi = (X' Sigma^-1 X)^-1 at the REML estimate and Sigma_i the derivatives of Sigma, Phi_A = Phi + 2 Phi S Phi with S = sum_ij W_ij (Q_ij - P_i Phi P_j - R_ij / 4), W twice the inverse REML expected information, and F* = lambda (L beta - l0)' (L Phi_A L')^-1 (L beta - l0) / q on q and m degrees of freedom (lambda and m as in pbkrtest). The R_ij second-derivative terms vanish when Sigma is linear in theta, which is the case pbkrtest's KRmodcomp handles; pass d2Sigma to include them for spatial covariance functions.

Usage

krftst(X, y, Sigma, dSigma, L, l0 = NULL, d2Sigma = NULL)

Arguments

X

Design matrix.

y

Response vector.

Sigma

Covariance matrix at the REML estimate.

dSigma

List of derivative matrices dSigma / dtheta_i.

L

Contrast matrix (q x p).

l0

Hypothesised value, default zero.

d2Sigma

Optional named list of second derivatives, names "i,j" with i <= j (1-based).

Value

Named list: beta, Phi, Phi_adjusted, F, ndf, ddf, scaling, p_value, F_unadjusted, p_value_unadjusted, W, A1, A2.

References

Kenward, M. G. & Roger, J. H. (1997). Biometrics 53, 983-997. Halekoh, U. & Hojsgaard, S. (2014). JSS 59(9). Schabenberger & Gotway (2005), eqs (6.53)-(6.54), p. 343.

Examples

g <- rep(1:4, each = 3)
x <- seq_len(12)
zz <- outer(g, g, "==") * 1
krftst(cbind(1, x), x + g, 0.5 * zz + diag(12), list(zz, diag(12)), matrix(c(0, 1), 1))$F
#> [1] 80.1729