Learn R Programming

agridat (version 1.5)

besag.elbatan: RCB experiment of 50 varieties of wheat in 3 blocks with strong spatial trend.

Description

RCB experiment of 50 varieties of wheat in 3 blocks with strong spatial trend.

Usage

data(besag.elbatan)

Arguments

source

Julian Besag and D Higdon, 1999. Bayesian Analysis of Agricultural Field Experiments, Journal of the Royal Statistical Society: Series B (Statistical Methodology),61, 691--746. Table 1. Retrieved from http://web.archive.org/web/19991008143232/www.stat.duke.edu/~higdon/trials/elbatan.dat. Used with permission of David Higdon.

Details

RCB experiment on wheat at El Batan, Mexico. There are three single-column replicates with 50 varieties in each replicate.

Examples

Run this code
dat <- besag.elbatan

# Besag figure 1
xyplot(yield~row, dat, groups=block, type=c('l'))

desplot(yield~block*row, dat)

# RCB
m1 <- lm(yield ~ 0 + gen + block, dat)
p1 <- coef(m1)[1:50]

# Add smooth trend with GAM
require(gam)
m2 <- gam(yield ~ 0 + gen + block + lo(row), data=dat)
plot(m2, residuals=TRUE, se=TRUE, col=dat$block)
p2 <- coef(m2)[1:50]

# Compare estimates
plot(p1, p2, xlab="RCB", ylab="RCB with smooth trend", type='n')
text(p1, p2, 1:50, cex=.5)
abline(0,1,col="gray")

Run the code above in your browser using DataLab