| Examp2.5.2.1 | R Documentation |
Examp2.5.2.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.
ex124
#-------------------------------------------------------------
## Example 2.5.2.1 p-68
#-------------------------------------------------------------
# PROC MIXED DATA=ex125;
# CLASS drug dose region;
# MODEL pcv=drug dose drug*dose / solution covb;
# RANDOM region drug*region;
# LSMEANS drug*dose;
# RUN;
str(ex125)
if (requireNamespace("lme4", quietly = TRUE) &&
requireNamespace("lmerTest", quietly = TRUE)) {
fm2.10 <-
lmerTest::lmer(
formula = Pcv ~ dose * Drug + (1 | Region / Drug)
, data = ex125
, REML = TRUE
, control = lme4::lmerControl()
, start = NULL
, verbose = 0L
, contrasts = list(dose = "contr.SAS", Drug = "contr.SAS")
, devFunOnly = FALSE
)
if (requireNamespace("report", quietly = TRUE)) {
fm2.10 |>
report::report()
}
if (requireNamespace("emmeans", quietly = TRUE)) {
emm2.10 <- emmeans::emmeans(fm2.10, ~ dose | Drug, lmer.df = "asymptotic")
print(emm2.10)
print(emmeans::contrast(emm2.10, method = "pairwise"))
}
summary(fm2.10)
anova(fm2.10)
summary(fm2.10)$vcov
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.