Commit 5fdd0512 authored by peguerin's avatar peguerin
Browse files

add modified ttest marine vs freshwater

parent 12c33954
......@@ -9,6 +9,7 @@
## Submited to Nature communications, 2019
##
## wilcoxon test
## spatial association test FRESHWATER/MARINE
## determination mediane
##
##########################################################################
......@@ -71,4 +72,24 @@ hist(dcM.1$GD_mean)
## test de Wilcoxon Genetic diversity
wilcox.test(dcM.1$GD_mean,dcF.1$GD_mean) # W =69070, p-value = 1.101e-09
## Wilcoxon Specific richness # W = 79143, p-value = 0.7306
wilcox.test(Mr$richness, Fr$richness)
\ No newline at end of file
wilcox.test(Mr$richness, Fr$richness)
##########################################################################
##### Modified t-test of spatial association test
###### between GDmean and species richness marine
coordsM = cbind(Mr$x,Mr$y)
zM <- cor.spatial(Mr$GD_mean,Mr$richness,coordsM)
modified.ttest(Mr$GD_mean,Mr$richness,coordsM, nclass = 13)
###### between GDmean and species richness freshwater
coordsF = cbind(Fr$x,Fr$y)
modified.ttest(Fr$GD_mean,Fr$richness,coordsF, nclass = 13)
###### between freshwater and marine genetic diversity
coordsM = cbind(Mr$x,Mr$y)
coordsF = cbind(Fr$x,Fr$y)
coordsT=rbind(coordsM,coordsF)
GD_meanT=data.frame(marine=Mr$GD_mean, freshwater= Fr$GD_mean)
modified.ttest(GD_meanT$marine, GDmeanT$freshwater,coordsT, nclass = 13)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment