Learn R Programming

PairedData (version 0.9.9)

Grain2: Wheat grain data from Preece (1982, Table 12)

Description

This dataset presents 6 paired data corresponding to the grain yields of two wheat varieties grown on pairs of plots.

Usage

data(Grain2)

Arguments

format

A dataframe with 6 rows and 3 columns: rlll{ [,1] Plot factor [,2] Variety_1 numeric grain yield (bushels per acre) [,3] Variety_2 numeric grain yield }

source

Balaam, N.L. (1972) Fundamentals of Biometry. The Science of Biology Series (ed J.D. Carthy and J.F. Sutcliffe), No3, Allen and Unwin: London.

References

Preece, D.A. (1982) t is for trouble (and textbooks): a critique of some examples of the paired-samples t-test. The Statistician, 31 (2), 169-195.

Examples

Run this code
data(Grain2)

# A very small data set
print(Grain2)

# The paired t test is the test of the differences
with(Grain2,t.test(Variety_1,Variety_2,paired=TRUE))
with(Grain2,t.test(Variety_1-Variety_2))

# The data are actually rounded to the nearest integer
# So they can be somewhere between +0.5 or -0.5
# and thus the differences between +1 or -1
# The possible t values can be simulated by:
simulating.t<-numeric(1000)
for(i in 1:1000){
simulating.t[i]<-with(Grain2,t.test(Variety_1-Variety_2+runif(6,-1,1)))$stat
}
hist(simulating.t)
abline(v=with(Grain2,t.test(Variety_1-Variety_2))$stat,lty=2)

Run the code above in your browser using DataLab