Learn R Programming

PASWR2 (version 1.0.5)

COWS: Butterfat of Cows

Description

Random samples of ten mature (five-years-old and older) and ten two-year-old cows were taken from each of five breeds. The average butterfat percentage of these 100 cows is stored in the variable butterfat with the type of cow stored in the variable breed and the age of the cow stored in the variable age.

Usage

COWS

Arguments

Format

A data frame with 100 observations on the following 3 variables:

  • butterfat (average butterfat percentage)

  • age (a factor with levels 2 years old and Mature)

  • breed (a factor with levels Ayrshire, Canadian, Guernsey, Holstein-Friesian, and Jersey)

References

  • Sokal, R. R. and Rohlf, F. J. 1994. Biometry. W. H. Freeman, New York, third edition.

  • Ugarte, M. D., Militino, A. F., and Arnholt, A. T. 2015. Probability and Statistics with R, Second Edition. Chapman & Hall / CRC.

Examples

Run this code
# NOT RUN {
ggplot(data = COWS, aes(x = breed, y = butterfat, fill = age)) + 
geom_boxplot(position = position_dodge(1.0)) + 
labs(x = "", y = "Average butterfat percentage") + scale_fill_brewer()
summary(aov(butterfat ~ breed + age, data = COWS))
# }

Run the code above in your browser using DataLab