1% File src/library/datasets/man/npk.Rd
2% Part of the R package, https://www.R-project.org
3% copyright (C) 1999 W. N. Venables and B. D. Ripley
4% Distributed under GPL 2 or later
5
6\name{npk}
7\alias{npk}
8\title{
9  Classical N, P, K Factorial Experiment
10}
11\description{
12  A classical N, P, K (nitrogen, phosphate, potassium) factorial
13  experiment on the growth of peas conducted on 6 blocks. Each half of a
14  fractional factorial design confounding the NPK interaction was used
15  on 3 of the plots.
16}
17\usage{
18npk
19}
20\format{
21  The \code{npk} data frame has 24 rows and 5 columns:
22  \describe{
23    \item{\code{block}}{
24      which block (label 1 to 6).
25    }
26    \item{\code{N}}{
27      indicator (0/1) for the application of nitrogen.
28    }
29    \item{\code{P}}{
30      indicator (0/1) for the application of phosphate.
31    }
32    \item{\code{K}}{
33      indicator (0/1) for the application of potassium.
34    }
35    \item{\code{yield}}{
36      Yield of peas, in pounds/plot (the plots were (1/70) acre).
37    }
38  }
39}
40\source{
41  Imperial College, London, M.Sc. exercise sheet.
42}
43\references{
44  Venables, W. N. and Ripley, B. D. (2002)
45  \emph{Modern Applied Statistics with S.} Fourth edition.  Springer.
46}
47% This gets different roundings
48\examples{\donttest{
49options(contrasts = c("contr.sum", "contr.poly"))
50npk.aov <- aov(yield ~ block + N*P*K, npk)
51npk.aov
52summary(npk.aov)
53coef(npk.aov)
54options(contrasts = c("contr.treatment", "contr.poly"))
55npk.aov1 <- aov(yield ~ block + N + K, data = npk)
56summary.lm(npk.aov1)
57se.contrast(npk.aov1, list(N=="0", N=="1"), data = npk)
58model.tables(npk.aov1, type = "means", se = TRUE)
59}}
60\keyword{datasets}
61