Examp3.2 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 3.3 p-88 #------------------------------------------------------------- # PROC MIXED DATA=ex32; # CLASS sex sire_id breed; # MODEL ww = sex agew breed/SOLUTION DDFM=SATTERTH; # RANDOM sire_id(breed)/SOLUTION; # LSMEANS breed/ADJUST = TUKEY; # RUN; library(lmerTest) str(ex32)
#> 'data.frame': 65 obs. of 5 variables: #> $ breed : int 1 1 1 1 1 1 1 1 1 1 ... #> $ sire_id: int 1971 1971 1971 1971 1972 1972 1972 1972 1972 1972 ... #> $ sex : Factor w/ 2 levels "F","M": 1 1 1 2 1 2 1 1 2 1 ... #> $ agew : int 145 140 140 122 152 151 146 139 132 131 ... #> $ Ww : num 11.2 15.4 10.9 11.4 16 13.2 14.9 7.9 15.7 13.1 ...
ex32$sire_id1 <- factor(ex32$sire_id) ex32$breed1 <- factor(ex32$breed) fm3.4 <- lmerTest::lmer( formula = Ww ~ sex + agew + breed1 + (1|sire_id1:breed1) , data = ex32 , REML = TRUE , control = lmerControl() , start = NULL , verbose = 0L # , subset # , weights # , na.action # , offset , contrasts = list(sex = "contr.SAS", breed1 = "contr.SAS") , devFunOnly = FALSE # , ... ) summary(fm3.4)
#> Linear mixed model fit by REML. t-tests use Satterthwaite's method [ #> lmerModLmerTest] #> Formula: Ww ~ sex + agew + breed1 + (1 | sire_id1:breed1) #> Data: ex32 #> #> REML criterion at convergence: 284.3 #> #> Scaled residuals: #> Min 1Q Median 3Q Max #> -2.5654 -0.6608 0.2366 0.6499 2.2953 #> #> Random effects: #> Groups Name Variance Std.Dev. #> sire_id1:breed1 (Intercept) 1.052e-16 1.026e-08 #> Residual 5.447e+00 2.334e+00 #> Number of obs: 65, groups: sire_id1:breed1, 15 #> #> Fixed effects: #> Estimate Std. Error df t value Pr(>|t|) #> (Intercept) -0.36196 3.12869 57.00000 -0.116 0.908304 #> sexF -1.43763 0.61338 57.00000 -2.344 0.022600 * #> agew 0.08386 0.02393 57.00000 3.505 0.000898 *** #> breed11 3.07302 1.13643 57.00000 2.704 0.009013 ** #> breed12 2.34510 1.22697 57.00000 1.911 0.060999 . #> breed13 0.54799 1.34825 57.00000 0.406 0.685939 #> breed14 2.68929 1.18700 57.00000 2.266 0.027291 * #> breed15 -0.32865 1.24771 57.00000 -0.263 0.793188 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Correlation of Fixed Effects: #> (Intr) sexF agew bred11 bred12 bred13 bred14 #> sexF 0.121 #> agew -0.944 -0.257 #> breed11 -0.146 0.065 -0.121 #> breed12 -0.023 0.161 -0.240 0.684 #> breed13 0.162 0.152 -0.406 0.643 0.651 #> breed14 -0.077 0.187 -0.196 0.702 0.685 0.654 #> breed15 -0.514 0.067 0.279 0.612 0.541 0.433 0.579
anova(object = fm3.4, ddf = "Satterthwaite")
#> Type III Analysis of Variance Table with Satterthwaite's method #> Sum Sq Mean Sq NumDF DenDF F value Pr(>F) #> sex 29.924 29.924 1 57 5.4932 0.0226004 * #> agew 66.904 66.904 1 57 12.2819 0.0008979 *** #> breed1 109.411 21.882 5 57 4.0170 0.0034289 ** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
lsmeansLT(model = fm3.4)
#> Least Squares Means table: #> #> Estimate Std. Error df t value lower upper Pr(>|t|) #> sexF 10.71994 0.42885 57 24.997 9.86118 11.57869 < 2.2e-16 *** #> sexM 12.15756 0.43216 57 28.132 11.29218 13.02295 < 2.2e-16 *** #> breed11 13.12398 0.60557 57 21.672 11.91136 14.33661 < 2.2e-16 *** #> breed12 12.39605 0.72013 57 17.214 10.95402 13.83809 < 2.2e-16 *** #> breed13 10.59894 0.87738 57 12.080 8.84202 12.35587 < 2.2e-16 *** #> breed14 12.74025 0.65697 57 19.392 11.42469 14.05581 < 2.2e-16 *** #> breed15 9.72230 0.86252 57 11.272 7.99513 11.44948 3.896e-16 *** #> breed16 10.05096 0.96866 57 10.376 8.11126 11.99066 9.546e-15 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Confidence level: 95% #> Degrees of freedom method: Satterthwaite