Learn R Programming

agridat (version 1.23)

ratkowsky.onions: Onion yields for different densities at two locations

Description

Onion yields for different densities at two locations

Arguments

Format

This data frame contains the following columns:

density

planting density (plants per square meter)

yield

yield (g / plant)

loc

location, Purnong Landing or Virginia

Details

Spanish white onions.

References

Ruppert, D., Wand, M.P. and Carroll, R.J. (2003). Semiparametric Regression. Cambridge University Press. https://stat.tamu.edu/~carroll/semiregbook/

Examples

Run this code
if (FALSE) {

library(agridat)
data(ratkowsky.onions)
dat <- ratkowsky.onions

# Model inverse yield as a quadratic.  Could be better...
libs(lattice)
dat <- transform(dat, iyield = 1/yield)
m1 <- lm(iyield ~ I(density^2)*loc, dat)
dat$pred <- predict(m1)

libs(latticeExtra)
foo <- xyplot(iyield ~ density, data=dat, group=loc, auto.key=TRUE,
               main="ratkowski.onions",ylab="Inverse yield")
foo + xyplot(pred ~ density, data=dat, group=loc, type='l')

}

Run the code above in your browser using DataLab