Exam5.3: Example 5.3 from Generalized Linear Mixed Models: Modern...

Description Author(s) References See Also Examples

Description

Exam5.3 Inference using empirical standard error with different Bias connection

Author(s)

  1. Muhammad Yaseen (myaseen208@gmail.com)

  2. Adeela Munawar (adeela.uaf@gmail.com)

References

  1. Stroup, W. W. (2012). Generalized Linear Mixed Models: Modern Concepts, Methods and Applications. CRC Press.

See Also

DataSet4.1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
data(DataSet4.1)
DataSet4.1$trt   <- factor(x = DataSet4.1$trt)
DataSet4.1$block <- factor( x = DataSet4.1$block)

##---REML estimates on page 172
library(lme4)
# library(lmerTest)
Exam5.3REML      <-
  lmer(
         formula    = y ~ trt + (1|block)
       , data       = DataSet4.1
       , REML       = TRUE
    #  , control    = lmerControl()
       , start      = NULL
    #  , verbose    = 0L
    #  , subset
    #  , weights
    #  , na.action
    #  , offset
       , contrasts  = NULL
       , devFunOnly = FALSE
    #  , ...
  )
##---Standard Error Type "Model Based" with no Bias Connection
AnovaExam5.3REML  <- anova( object = Exam5.3REML )
AnovaExam5.3REML

##---Standard Error Type "Model Based" with "Kenward-Roger approximation" Bias Connection
# library(pbkrtest)
anova( object = Exam5.3REML, ddf  = "Kenward-Roger")

##---ML estimates on page 172
Exam5.3ML      <-
  lmer(
        formula      = y ~ trt + ( 1|block )
       , data        = DataSet4.1
       , REML        = FALSE
   #   , control     = lmerControl()
       , start       = NULL
   #   , verbose     = 0L
   #   , subset
   #   , weights
   #   , na.action
   #   , offset
       , contrasts   = NULL
       , devFunOnly  = FALSE
   #   , ...
  )
  
##---Standard Error Type "Model Based" with no Bias Connection
AnovaExam5.3ML  <- anova( object = Exam5.3ML )
AnovaExam5.3ML

##---Standard Error Type "Model Based" with "Kenward-Roger approximation" Bias Connection
anova( object = Exam5.3ML, ddf = "Kenward-Roger")

StroupGLMM documentation built on May 2, 2019, 9:42 a.m.