Examp1.3.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 1.3.2 p-16 #------------------------------------------------------------- # PROC GLM DATA=ex124; # CLASS herd dose drug; # MODEL PCVdif=drug herd(drug) dose dose*drug; # RANDOM herd(drug); # RUN; library(lme4)
#> Loading required package: Matrix
str(ex124)
#> 'data.frame': 40 obs. of 4 variables: #> $ herd : int 1 1 1 1 1 1 1 1 1 1 ... #> $ drug : Factor w/ 2 levels "Berenil","Samorin": 1 1 1 1 1 1 1 1 1 1 ... #> $ dose : Factor w/ 2 levels "h","l": 2 2 2 2 2 1 1 1 1 1 ... #> $ PCVdif: num 2.5 1.6 3.5 2.6 2.8 6.9 6.8 7.2 5.9 6.5 ...
summary(ex124)
#> herd drug dose PCVdif #> Min. :1.00 Berenil:20 h:20 Min. :1.600 #> 1st Qu.:1.75 Samorin:20 l:20 1st Qu.:3.225 #> Median :2.50 Median :5.250 #> Mean :2.50 Mean :5.263 #> 3rd Qu.:3.25 3rd Qu.:7.225 #> Max. :4.00 Max. :8.700
ex124$herd1 <- factor(ex124$herd) ex124$drug1 <- factor(ex124$drug) ex124$dose1 <- factor(ex124$dose) fm1.1 <- aov( formula = PCVdif ~ drug1 + Error(herd1:drug1) + dose1 + dose1:drug1 , data = ex124 , projections = FALSE , qr = TRUE , contrasts = NULL # , ... )
#> Warning: Error() model is singular
summary(fm1.1)
#> #> Error: herd1:drug1 #> Df Sum Sq Mean Sq F value Pr(>F) #> drug1 1 1.722 1.722 0.305 0.636 #> Residuals 2 11.300 5.650 #> #> Error: Within #> Df Sum Sq Mean Sq F value Pr(>F) #> dose1 1 172.64 172.64 732.394 <2e-16 *** #> drug1:dose1 1 0.16 0.16 0.663 0.421 #> Residuals 34 8.01 0.24 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1