An exact correlation for ties or without ties. Methods of Kendall, Spearman and Pearson.

correl(x, y, method = "pearson", alternative = "two.sided")

Arguments

x

Vector

y

Vector

method

"pearson", "kendall", "spearman"

alternative

"two.sided", "less", "greater"

Value

The correlation of x,y vector with the statistical value and its probability

References

Numerical Recipes in C. Second Edition.

See also

Examples

library(agricolae) data(soil) with(soil,correl(pH,clay,method="kendall"))
#> $stat #> [1] 3.31896 #> #> $rho #> [1] 0.7105263 #> #> $pvalue #> [1] 0.0009035325 #>
with(soil,correl(pH,clay,method="spearman"))
#> $stat #> [1] 5.402257 #> #> $rho #> [1] 0.8522099 #> #> $pvalue #> [1] 0.0002159178 #>
with(soil,correl(pH,clay,method="pearson"))
#> $stat #> [1] 4.655866 #> #> $rho #> [1] 0.814477 #> #> $pvalue #> [1] 0.0006983906 #>