1.两独样本参数的非参数检验
1.1.Welcoxon秩和检验
先将两样本看成是单一样本(混合样本)然后由小到大排列观察值统一编秩。如果原假设两个独立样本来自相同的总体为真,那么秩将大约均匀分布在两个样本中,即小的、中等的、大的秩值应该大约被均匀分在两个样本中。如果备选假设两个独立样本来自不相同的总体为真,那么其中一个样本将会有更多的小秩值,这样就会得到一个较小的秩和;另一个样本将会有更多的大秩值,因此就会得到一个较大的秩和。
R:wilcox.test
##################独立样本的曼-惠特尼U检验 Forest<-read.table(file="ForestData.txt",header=TRUE,sep=" ") Forest$month<-factor(Forest$month,levels=c("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec")) Tmp<-subset(Forest,Forest$month=="jan" | Forest$month=="aug") wilcox.test(temp~month,data=Tmp)
Wilcoxon rank sum test with continuity correction
data: temp by month
W = 2, p-value = 0.01653
alternative hypothesis: true location shift is not equal to 0
1.2.K-S检验
##################独立样本的K-S检验 x1<-subset(Forest,Forest$month=="jan") x2<-subset(Forest,Forest$month=="aug") ks.test(x1$temp,x2$temp)
Two-sample Kolmogorov-Smirnov test
data: x1$temp and x2$temp
D = 0.99457, p-value = 0.03992
alternative hypothesis: two-sided
1.3.两配对样本分布
###############配对样本的Wilcoxon符号秩检验 ReportCard<-read.table(file=&#