Description Author(s) References See Also Examples
Examp2.6.1 is used for inspecting probability distribution and to define a plausible process through linear models and generalized linear models.
Muhammad Yaseen (myaseen208@gmail.com)
Duchateau, L. and Janssen, P. and Rowlands, G. J. (1998).Linear Mixed Models. An Introduction with applications in Veterinary Research. International Livestock Research Institute.
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  | #-------------------------------------------------------------
## Example 2.6.1 p-76
#-------------------------------------------------------------
 # PROC MIXED DATA=ex125;
 # CLASS drug dose region;
 # MODEL pcv=drug dose drug*dose / ddfm=satterth;
 # RANDOM region drug*region;
 # CONTRAST 'drug dif' drug -1 1 drug*dose -0.5 -0.5 0.5 0.5;
 # CONTRAST 'all' drug 1 -1 dose 0  0 drug*dose 0.5  0.5 -0.5 -0.5,
 #                drug 0  0 dose 1 -1 drug*dose 0.5 -0.5  0.5 -0.5,
 #                drug 0  0 dose 0  0 drug*dose 0.5 -0.5 -0.5  0.5;
 # RUN;
 library(lmerTest)
 str(ex125)
 ex125$Region1 <- factor(ex125$Region)
 fm2.14 <-
  lmerTest::lmer(
         formula    = Pcv ~ dose*Drug + (1|Region/Drug)
       , data       = ex125
       , REML       = TRUE
       , control    = lmerControl()
       , start      = NULL
       , verbose    = 0L
    #  , subset
    #  , weights
    #  , na.action
    #  , offset
       , contrasts  = list(dose = "contr.SAS", Drug = "contr.SAS")
       , devFunOnly = FALSE
    #  , ...
       )
 summary(fm2.14)
 anova(object = fm2.14, ddf = "Satterthwaite")
 library(multcomp)
 Contrasts3 <-
           matrix(c(
                    0, 0, -1, -0.5
                   )
                , ncol = 4
                , byrow = TRUE
                , dimnames = list(
                   c("C1")
                 , rownames(summary(fm2.14)$coef)
                )
               )
 Contrasts3
 summary(glht(fm2.14, linfct=Contrasts3))
if(packageVersion("lmerTest") >= "3.0")
   contest(fm2.14, Contrasts3, joint = FALSE)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.