dat <- pearl.kernels
xyplot(ys+yt+ws+wt~obs|ear, dat, type='l', as.table=TRUE, auto.key=TRUE,
layout=c(4,1), scales=list(x=list(rot=90)))
# Test hypothesis that distribution is 'Mendelian' 9:3:3:1
dat$pval <- apply(dat[, 3:6], 1, function(x)
chisq.test(x, p=c(9,3,3,1)/16)$p.val)
dotplot(pval~obs|ear, dat, layout=c(1,4))Run the code above in your browser using DataLab