Learn R Programming

agricolae (version 1.0-1)

cor.mv: Correlation between groups of variables

Description

It obtains the coefficients of correlation between two groups of variables, along with p-value, by means of the methods of Pearson, Spearman or Kendall. By default it is Pearson. Results similar to the SAS

Usage

cor.mv(aa, bb, method = c("pearson", "kendall", "spearman")
,alternative="two.sided")

Arguments

aa
first group. Vector o data frame
bb
Second group. Vector or data frame
method
"pearson", "kendall", "spearman"
alternative
"two.sided", "less", "greater"

Value

  • aaNumeric
  • bbNumeric

Details

Parameters equal to function cor()

See Also

cor.vector, cor.matrix, correl

Examples

Run this code
library(agricolae)
data(soil)
# correlation between pH, variable 2 and other elements from soil.
correlation<-cor.mv(soil[,2],soil[,c(-1,-2)],method="pearson")
correlation

Run the code above in your browser using DataLab