Learn R Programming

agridat (version 1.23)

harvey.lsmeans: Average daily gain of 65 steers for 3 lines, 9 sires.

Description

Average daily gain of 65 steers for 3 lines, 9 sires.

Usage

data("harvey.lsmeans")

Arguments

Format

A data frame with 65 observations on the following 7 variables.

line

line of the dam

sire

sire

damage

age class of the dam

calf

calf number

weanage

calf age at weaning

weight

calf weight at start of feeding

adg

average daily gain

Details

The average daily gain 'adg' for each of 65 Hereford steers.

The calf age at weaning and initial weight at the beginning of the test feeding is also given.

The steers were fed for the same length of time in the feed lot.

It is assumed that each calf has a unique dam and there are no twins or repeat matings.

Harvey (1960) is one of the earliest papers presenting least squares means (lsmeans).

References

Also appears in the 'dmm' package as 'harv101.df' See that package vignette for a complete analysis of the data.

Examples

Run this code
if (FALSE) {

library(agridat)
data(harvey.lsmeans)
dat = harvey.lsmeans

libs(lattice)
dotplot(adg ~ sire|line,dat,
        main="harvey.lsmeans", xlab="sire", ylab="average daily gain")

# Model suggested by Harvey on page 103
m0 <- lm(adg ~ 1 + line + sire + damage + line:damage + weanage +
         weight, data=dat)

# Due to contrast settings, it can be hard to compare model coefficients to Harvey,
# but note the slopes of the continuous covariates match Harvey p. 107, where his
# b is weanage, d is weight
# coef(m0)
#       weanage       weight 
#  -0.008154879  0.001970446
  
# A quick attempt to reproduce table 4 of Harvey, p. 109. Not right.
# libs(emmeans)
# emmeans(m0,c('line','sire','damage'))

}

Run the code above in your browser using DataLab