Created
July 19, 2010 13:45
-
-
Save grassa/481422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## read in our data | |
data<-read.table("binned.ele",head=T) | |
## how are our variables named? | |
names(data) | |
## attach them | |
attach(data) | |
## are the sample variances significantly different? | |
var.test(BEFORE,AFTER) | |
## they're not, so we can't use a t-test | |
## we use the wilcoxon's rank test | |
wilcox.test(BEFORE,AFTER) | |
## the means are highly significantly different | |
## let's look at the distribution of differences between "before" and "after" for all species | |
DIFF<-(AFTER-BEFORE) | |
## we'll output to a pdf | |
pdf("mean_alt_diff.pdf") | |
## plot the histogram | |
hist(DIFF,xlab="Difference in mean altitude (m)",ylab="Number of species",main="") | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment