Learn R Programming

RVAideMemoire (version 0.9-11)

cor.multcomp: Comparison of several Pearson's linear correlation coefficients

Description

Perform comparisons of several Pearson's linear correlation coefficients. If no difference, the function returns the common correlation coefficient, its confidence interval and test for its equality to a given value. If difference is significative, the functions performs pairwise comparisons between coefficients.

Usage

cor.multcomp(var1, var2, fact, alpha = 0.05, conf.level = 0.95, theo = 0, p.method = "fdr")

Arguments

var1
numeric vector (first variable).
var2
numeric vector (second variable).
fact
factor (groups).
alpha
significance level.
conf.level
confidence level.
theo
theoretical coefficient.
p.method
method for p-values correction. See help of the p.adjust() function.

Value

  • levelsnumber of levels of fact.
  • conf.levelconfidence level.
  • alphasignificance level.
  • coeffsobserved correlation coefficients.
  • statistic.comptest statistics for equality of all coefficients.
  • p.value.compp-value for equality of all coefficients.
  • compdata frame of results for equality of all coefficients.
  • r.commcommon correlation coefficient and confidence interval.
  • r.theotheoretical coefficient.
  • statistic.commtest statistics for equality of the common coefficient to the theoretical value.
  • p.value.commp-value for equality of the common coefficient to the theoretical value.
  • commdata frame for equality of the common coefficient to the theoretical value.
  • p.adjust.methodmethod for p-values correction.
  • p.multcompdata frame of results of pairwise comparisons.

See Also

cor.test

Examples

Run this code
var1 <- c(1:15+rnorm(15,0,4),1:15+rnorm(15,0,1),1:15+rnorm(15,0,8))
var2 <- c(-1:-15+rnorm(15,0,4),1:15+rnorm(15,0,1),1:15+rnorm(15,0,8))
fact <- gl(3,15,labels=LETTERS[1:3])
cor.multcomp(var1,var2,fact)

var3 <- c(1:15+rnorm(15,0,1),1:15+rnorm(15,0,3),1:15+rnorm(15,0,2))
cor.multcomp(var1,var3,fact)

Run the code above in your browser using DataLab