Learn R Programming

lsmeans (version 1.10-3)

nutrition: Nutrition data

Description

This observational dataset involves three factors, but where several factor combinations are missing. It is used as a case study in Milliken and Johnson, Chapter 17, p.202. (You may also find it in the second edition, p.278.)

Usage

nutrition

Arguments

source

Milliken, G. A. and Johnson, D. E. (1984) Analysis of Messy Data -- Volume I: Designed Experiments. Van Nostrand, ISBN 0-534-02713-7.

Details

A survey was conducted by home economists ``to study how much lower-socioeconomic-level mothers knew about nutrition and to judge the effect of a training program designed to increase therir knowledge of nutrition.'' This is a messy dataset with several empty cells.

Examples

Run this code
require(lsmeans)
nutr.aov <- aov(gain ~ (group + age + race)^2, data = nutrition)

# Summarize predictions for age group 3
nutr.lsm <- lsmeans(nutr.aov, list(pairwise ~ group|race, pairwise ~ race|group),
                   at = list(age="3"))
                   
with(nutr.lsm[[1]], interaction.plot(group, race, lsmean, type="b"))

# Hispanics seem exceptional; but, this doesn't test out due to very sparse data
print(nutr.lsm, omit=3)

Run the code above in your browser using DataLab