AvgDailyGain {SASmixed} | R Documentation |
The AvgDailyGain
data frame has 32 rows and 6 columns.
This data frame contains the following columns:
0
< 10
< 20
< 30
indicating the amount of medicated feed additive added to
the base ration.
Treatment
as a numeric variable
Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, R. D. (1996), SAS System for Mixed Models, SAS Institute (Data Set 5.3).
str(AvgDailyGain) if (require("lattice", quietly = TRUE, character = TRUE)) { ## plot of adg versus Treatment by Block xyplot(adg ~ Treatment | Block, AvgDailyGain, type = c("g", "p", "r"), xlab = "Treatment (amount of feed additive)", ylab = "Average daily weight gain (lb.)", aspect = "xy", index.cond = function(x, y) coef(lm(y ~ x))[1]) } if (require("lme4", quietly = TRUE, character = TRUE)) { options(contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")) ## compare with output 5.1, p. 178 print(fm1Adg <- lmer(adg ~ InitWt * Treatment - 1 + (1 | Block), AvgDailyGain)) print(anova(fm1Adg)) # checking significance of terms print(fm2Adg <- lmer(adg ~ InitWt + Treatment + (1 | Block), AvgDailyGain)) print(anova(fm2Adg)) print(lmer(adg ~ InitWt + Treatment - 1 + (1 | Block), AvgDailyGain)) }