##Spearman rank correlation test ##IF p-value > 0.05, THEN we accept H0 and there is NO correlation ##IF p-value < 0.05, THEN we accept H1 and there is correlation pSpear=cor.test(Index,Component,method="spearman")$p.value; pSpearman[counter]=pSpear #Store p-values from Spearman test if (pSpear>0.05) { hypSpearman[counter]="H0" #Store negative conclusions from Spearman test } else { hypSpearman[counter]="H1" #Store positive conclusions from Spearman test } rSpear=cor(Index,Component,method="spearman"); rSpearman[counter]=rSpear #Store Spearman correlation coefficients r