Examp2.5.4.1 is used for inspecting probability distribution and to define a plausible process through linear models and generalized linear models.

References

  1. Duchateau, L. and Janssen, P. and Rowlands, G. J. (1998).Linear Mixed Models. An Introduction with applications in Veterinary Research. International Livestock Research Institute.

See also

Examples

#------------------------------------------------------------- ## Example 2.5.4.1 p-74 #------------------------------------------------------------- # PROC MIXED DATA=ex125; # CLASS drug dose region; # MODEL pcv=drug dose drug*dose / ddfm=satterth; # RANDOM region drug*region; # ESTIMATE 'Samorin mean' INTERCEPT 1 drug 0 1 dose 0.5 0.5 # drug*dose 0 0 0.5 0.5; # RUN; # PROC GLM DATA=ex125; # CLASS drug dose region; # MODEL pcv=region drug region*drug dose drug*dose; # ESTIMATE 'Samorin mean' INTERCEPT 1 drug 0 1 dose 0.5 0.5 # drug*dose 0 0 0.5 0.5; # RUN; library(lme4) str(ex125)
#> 'data.frame': 24 obs. of 4 variables: #> $ Region: int 1 1 1 1 2 2 2 2 3 3 ... #> $ Drug : Factor w/ 2 levels "BERENIL","samorin": 1 1 2 2 1 1 2 2 1 1 ... #> $ dose : Factor w/ 2 levels "h","l": 1 2 1 2 1 2 1 2 1 2 ... #> $ Pcv : num 22.6 21.8 19.1 16.4 29 28.8 25.3 18.2 24 23.7 ...
ex125$Region1 <- factor(ex125$Region) fm2.13 <- 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.13)
#> Linear mixed model fit by REML. t-tests use Satterthwaite's method [ #> lmerModLmerTest] #> Formula: Pcv ~ dose * Drug + (1 | Region/Drug) #> Data: ex125 #> #> REML criterion at convergence: 92.4 #> #> Scaled residuals: #> Min 1Q Median 3Q Max #> -1.71077 -0.51628 0.08414 0.70276 1.16129 #> #> Random effects: #> Groups Name Variance Std.Dev. #> Drug:Region (Intercept) 0.387 0.6221 #> Region (Intercept) 5.151 2.2695 #> Residual 2.096 1.4479 #> Number of obs: 24, groups: Drug:Region, 12; Region, 6 #> #> Fixed effects: #> Estimate Std. Error df t value Pr(>|t|) #> (Intercept) 17.1333 1.1280 8.2080 15.189 2.69e-07 *** #> doseh 4.3500 0.8359 10.0000 5.204 0.000399 *** #> DrugBERENIL 7.1500 0.9098 11.8185 7.859 4.96e-06 *** #> doseh:DrugBERENIL -3.1833 1.1822 10.0000 -2.693 0.022594 * #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Correlation of Fixed Effects: #> (Intr) doseh DBEREN #> doseh -0.371 #> DrugBERENIL -0.403 0.459 #> ds:DBERENIL 0.262 -0.707 -0.650
library(multcomp) Contrasts2 <- matrix(c( 1, 0.5, 0, 0 ) , ncol = 4 , byrow = TRUE , dimnames = list( c("C5") , rownames(summary(fm2.13)$coef) ) ) Contrasts2
#> (Intercept) doseh DrugBERENIL doseh:DrugBERENIL #> C5 1 0.5 0 0
summary(glht(fm2.13, linfct=Contrasts2))
#> #> Simultaneous Tests for General Linear Hypotheses #> #> Fit: lmerTest::lmer(formula = Pcv ~ dose * Drug + (1 | Region/Drug), #> data = ex125, REML = TRUE, control = lmerControl(), start = NULL, #> verbose = 0L, contrasts = list(dose = "contr.SAS", Drug = "contr.SAS"), #> devFunOnly = FALSE) #> #> Linear Hypotheses: #> Estimate Std. Error z value Pr(>|z|) #> C5 == 0 19.308 1.048 18.43 <2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> (Adjusted p values reported -- single-step method) #>