streams <- read.table("c:\\temp\\streams.txt",header=T)
attach(streams)
attach(streams)
names(streams)
t.test(down,up)
t.test(down,up,paired=TRUE)
difference <- up - down
t.test(difference)
8.6 The sign test
binom.test(1,9)
sign.test <- function(x, y)
{
if(length(x) != length(y)) stop("The two variables must be the same length")
d <- x - y
binom.test(sum(d > 0), length(d))
}
sign.test(gardenA,gardenB)