RLRsim : Testing for Random Effects or Nonparametric Regression - - PowerPoint PPT Presentation

rlrsim testing for random effects or nonparametric
SMART_READER_LITE
LIVE PREVIEW

RLRsim : Testing for Random Effects or Nonparametric Regression - - PowerPoint PPT Presentation

Background & Problem Description Implementation & Application Examples Simulation Study RLRsim : Testing for Random Effects or Nonparametric Regression Functions in Additive Mixed Models Fabian Scheipl 1 joint work with Sonja Greven 1 ,


slide-1
SLIDE 1

Background & Problem Description Implementation & Application Examples Simulation Study

RLRsim: Testing for Random Effects or Nonparametric Regression Functions in Additive Mixed Models

Fabian Scheipl 1 joint work with Sonja Greven 1,2 and Helmut K¨ uchenhoff 1

1Department of Statistics, LMU M¨

unchen, Germany

2Department of Biostatistics, Johns Hopkins University, USA

useR! 2008 August 13, 2008

slide-2
SLIDE 2

Background & Problem Description Implementation & Application Examples Simulation Study

Outline

Background & Problem Description Implementation & Application Examples Simulation Study

slide-3
SLIDE 3

Background & Problem Description Implementation & Application Examples Simulation Study

Linear Mixed Models

y = Xβ +

L

  • l=1

Zlbl + ε bl ∼ NKl(0, λlσ2

εΣl), bl⊥bs ∀l = s

ε ∼ Nn(0, σ2

εIn),

slide-4
SLIDE 4

Background & Problem Description Implementation & Application Examples Simulation Study

Linear Mixed Models

y = Xβ +

L

  • l=1

Zlbl + ε bl ∼ NKl(0, λlσ2

εΣl), bl⊥bs ∀l = s

ε ∼ Nn(0, σ2

εIn),

We want to test H0,l : λl = 0 versus HA,l : λl > 0 ⇔ H0,l : Var(bl) = 0 versus HA,l : Var(bl) > 0 Application examples:

◮ testing for equality of means between groups/subjects ◮ testing for linearity of a smooth function

slide-5
SLIDE 5

Background & Problem Description Implementation & Application Examples Simulation Study

Additive Models as Linear Mixed Models

Simple additive model: y = f (x) + ε f (xi) ≈

J

  • j=1

δjBj(xi)

◮ fit via PLS: min δ

  • y − Bδ2 + 1

λδ′Pδ

  • ◮ reparametrize s.t. PLS-estimation is equivalent to

(RE)ML-estimation

slide-6
SLIDE 6

Background & Problem Description Implementation & Application Examples Simulation Study

Additive Models as Linear Mixed Models

Simple additive model: y = f (x) + ε f (xi) ≈

J

  • j=1

δjBj(xi)

◮ fit via PLS: min δ

  • y − Bδ2 + 1

λδ′Pδ

  • ◮ reparametrize s.t. PLS-estimation is equivalent to

(RE)ML-estimation given λ in a LMM with

◮ fixed effects for the unpenalized part of f (x) ◮ random effects (

i.i.d.

∼ N(0, λσ2

ε)) for the deviations from the

unpenalized part (Brumback, Ruppert, Wand, 1999; Fahrmeir, Kneib, Lang, 2004)

◮ In R: mgcv::gamm(), lmeSplines

slide-7
SLIDE 7

Background & Problem Description Implementation & Application Examples Simulation Study

Problem: Likelihood Ratio Tests for Zero Variance Components

General Case:

◮ y1, . . . , yn i.i.d.

∼ f (y|θ); θ = (θ1, . . . , θp)

◮ Test: H0 : θi = θ0 i versus HA : θi = θ0 i ◮ LRT = 2 log L(ˆ

θ|y) − 2 log L(ˆ θ0|y) n→∞ ∼ χ2

1

slide-8
SLIDE 8

Background & Problem Description Implementation & Application Examples Simulation Study

Problem: Likelihood Ratio Tests for Zero Variance Components

General Case:

◮ y1, . . . , yn i.i.d.

∼ f (y|θ); θ = (θ1, . . . , θp)

◮ Test: H0 : θi = θ0 i versus HA : θi = θ0 i ◮ LRT = 2 log L(ˆ

θ|y) − 2 log L(ˆ θ0|y) n→∞ ∼ χ2

1

Problem for testing H0 : Var(bl) = 0 Underlying assumptions for asymptotics violated:

◮ data in LMM not independent ◮ θ0 not an interior point of the parameter space Θ

slide-9
SLIDE 9

Background & Problem Description Implementation & Application Examples Simulation Study

Previous Results:

◮ Stram, Lee (1994); Self, Liang (1987): for i. i. d.

  • bservations/subvectors, testing on the boundary of Θ:

LRT as ∼ 0.5δ0 : 0.5χ2

1

slide-10
SLIDE 10

Background & Problem Description Implementation & Application Examples Simulation Study

Previous Results:

◮ Stram, Lee (1994); Self, Liang (1987): for i. i. d.

  • bservations/subvectors, testing on the boundary of Θ:

LRT as ∼ 0.5δ0 : 0.5χ2

1 ◮ Crainiceanu, Ruppert (2004):

◮ Stram/Lee mixture very conservative for non-i. i. d. data, small

samples

◮ LRT often with large point mass at zero, restricted LRT

(RLRT) more useful

◮ derive exact finite sample distributions of LRT and RLRT in

LMMs with one variance component

slide-11
SLIDE 11

Background & Problem Description Implementation & Application Examples Simulation Study

Previous Results:

◮ Stram, Lee (1994); Self, Liang (1987): for i. i. d.

  • bservations/subvectors, testing on the boundary of Θ:

LRT as ∼ 0.5δ0 : 0.5χ2

1 ◮ Crainiceanu, Ruppert (2004):

◮ Stram/Lee mixture very conservative for non-i. i. d. data, small

samples

◮ LRT often with large point mass at zero, restricted LRT

(RLRT) more useful

◮ derive exact finite sample distributions of LRT and RLRT in

LMMs with one variance component

◮ Greven et al. (2007):

pseudo-ML arguments to justify application of results in Crainiceanu, Ruppert (2004) to models with multiple variance components

slide-12
SLIDE 12

Background & Problem Description Implementation & Application Examples Simulation Study

RLRsim: Algorithm

RLRTn ∼ sup

λ≥0

  • (n − p) log
  • 1 + Nn(λ)

Dn(λ)

K

  • k=1

log (1 + λµk,n)

  • ,

Nn(λ) =

K

  • k=1

λµk,n 1 + λµk,n w2

k ; Dn(λ) = K

  • k=1

w2

k

1 + λµk,n +

n−p

  • k=K+1

w2

k

wk ∼ N(0, 1); µ: eigenvalues of Σ1/2Z′(In − X(X′X)−1X)ZΣ1/2

slide-13
SLIDE 13

Background & Problem Description Implementation & Application Examples Simulation Study

RLRsim: Algorithm

RLRTn ∼ sup

λ≥0

  • (n − p) log
  • 1 + Nn(λ)

Dn(λ)

K

  • k=1

log (1 + λµk,n)

  • ,

Nn(λ) =

K

  • k=1

λµk,n 1 + λµk,n w2

k ; Dn(λ) = K

  • k=1

w2

k

1 + λµk,n +

n−p

  • k=K+1

w2

k

wk ∼ N(0, 1); µ: eigenvalues of Σ1/2Z′(In − X(X′X)−1X)ZΣ1/2 Rapid simulation from this distribution:

◮ do eigenvalue decomposition to get µ ◮ repeat:

◮ draw (K + 1) χ2 variates ◮ one-dimensional maximization in λ (via grid search)

slide-14
SLIDE 14

Background & Problem Description Implementation & Application Examples Simulation Study

RLRsim: Algorithm

RLRTn ∼ sup

λ≥0

  • (n − p) log
  • 1 + Nn(λ)

Dn(λ)

K

  • k=1

log (1 + λµk,n)

  • ,

Nn(λ) =

K

  • k=1

λµk,n 1 + λµk,n w2

k ; Dn(λ) = K

  • k=1

w2

k

1 + λµk,n +

n−p

  • k=K+1

w2

k

wk ∼ N(0, 1); µ: eigenvalues of Σ1/2Z′(In − X(X′X)−1X)ZΣ1/2 Rapid simulation from this distribution:

◮ do eigenvalue decomposition to get µ ◮ repeat:

◮ draw (K + 1) χ2 variates ◮ one-dimensional maximization in λ (via grid search)

→ computational cost depends on K, not n → implemented in C ⇒ quasi-instantaneous → easy extension to models with L > 1

slide-15
SLIDE 15

Background & Problem Description Implementation & Application Examples Simulation Study

Example: One Variance Component

Test for random intercept (nlme::lme):

> m0 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) > system.time(print( exactRLRT(m0) ), gcFirst=T) simulated finite sample distribution of RLRT. (p-value based on 10000 simulated values) RLRT = 47.0114, p-value < 2.2e-16 user system elapsed 0.42 0.00 0.42 > system.time(simulate.lme(m0,nsim=10000,method=✬REML✬), gcFirst=T) user system elapsed 55.00 0.03 55.48

slide-16
SLIDE 16

Background & Problem Description Implementation & Application Examples Simulation Study

Example: Two Variance Components

Test for random slope with nuisance random intercept (lme4::lmer):

> m0 <- lmer(distance ~ age + Sex + (1|Subject), data = Orthodont) > mA <- update(m0, .~. + (0 + age|Subject)) > mSlope <- update(mA, .~. - (1|Subject)) > exactRLRT(mSlope, mA, m0) simulated finite sample distribution of RLRT. (p-value based on 10000 simulated values) RLRT = 0.8672, p-value = 0.1603

slide-17
SLIDE 17

Background & Problem Description Implementation & Application Examples Simulation Study

Example: Testing for Linearity of a Smooth Function

> library(mgcv); data(trees) > m1 <- gamm(I(log(Volume)) ~ Height + s(Girth, m = 2), + data = trees)$lme

8 10 12 14 16 18 20 −0.5 0.0 0.5 1.0 Girth s(Girth,2.72)

s(Girth, m=2)

Significant deviations from linearity?

slide-18
SLIDE 18

Background & Problem Description Implementation & Application Examples Simulation Study

Example: Testing for Linearity of a Smooth Function

> library(mgcv); data(trees) > m1 <- gamm(I(log(Volume)) ~ Height + s(Girth, m = 2), + data = trees)$lme > exactRLRT(ml) simulated finite sample distribution of RLRT. (p-value based on 10000 simulated values) RLRT = 5.4561, p-value = 0.0052

slide-19
SLIDE 19

Background & Problem Description Implementation & Application Examples Simulation Study

Simulation Study: Settings

H0 tested VC nuisance VCs equality of group means random intercept

  • random slope

uni-/bivariate smooth equality of group trends random slope random intercept no effect / linearity univariate smooth

  • random intercept

uni-/bivariate smooth additivity bivariate smooth 2 univariate smooths Goal: compare size & power of tests for zero variance components

◮ sample sizes n = 50, 100, 500 ◮ mildly unbalanced group sizes for K = 5, 20 ◮ details: Scheipl, Greven, K¨

uchenhoff (2007)

slide-20
SLIDE 20

Background & Problem Description Implementation & Application Examples Simulation Study

Simulation study

Compared Tests:

◮ RLR-type tests:

RLRsim, parametric bootstrap, 0.5δ0 : 0.5χ2

1 ◮ F-type tests:

bootstrap F-type statistics, mgcv’s approximate F-test, SAS-implementations of generalized F-test etc..

slide-21
SLIDE 21

Background & Problem Description Implementation & Application Examples Simulation Study

Simulation study

Compared Tests:

◮ RLR-type tests:

RLRsim, parametric bootstrap, 0.5δ0 : 0.5χ2

1 ◮ F-type tests:

bootstrap F-type statistics, mgcv’s approximate F-test, SAS-implementations of generalized F-test etc.. Main Results:

◮ RLRsim: equivalent performance to bootstrap RLRT, but

practically instantaneous

◮ χ2-mixture approximation for RLRT: always conservative,

lower than nominal size & reduced power

◮ bootstrap RLRT, bootstrap F-type statistics similar ◮ F-test from mgcv: similar power as χ2-mixture, occasionally

seriously anti-conservative

slide-22
SLIDE 22

Background & Problem Description Implementation & Application Examples Simulation Study

Conclusion

◮ conventional RLRTs for Var(Random Effect) = 0 are broken,

but not beyond repair. ⇒ RLRsim

◮ is a rapid, more powerful alternative that performs as well as a

parametric bootstrap.

◮ has a convenient interface for models fit with nlme::lme or

lme4::lmer.

◮ Current limitations: no correlated random effects, no serial

correlation, only Gaussian responses.

slide-23
SLIDE 23

Background & Problem Description Implementation & Application Examples Simulation Study

Further Reading:

◮ Crainiceanu, C. and Ruppert, D. (2004) Likelihood ratio tests

in linear mixed models with one variance component, JRSS-B, 66(1), 165–185.

◮ Greven, S., Crainiceanu, C. M., K¨

uchenhoff, H. and Peters, A. (2008) Restricted Likelihood Ratio Testing for Zero Variance Components in Linear Mixed Models, JCGS, to appear.

◮ Scheipl, F., Greven, S., and K¨

uchenhoff, H. (2008) Size and power of tests for a zero random effect variance or polynomial regression in additive and linear mixed models, CSDA, 52(7), 3283–3299.