Learn R Programming

RVAideMemoire (version 0.9-6)

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

Description

Perform comparisons of 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 (gorups).
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.
  • chi2.comptest statistics for equality of all coefficients.
  • p.compp-value fot equality of all coefficients.
  • compdata.frame of results for equality of all coefficients.
  • r.commcommon correlation coefficient.
  • r.theotheoretical coefficient.
  • u.commtest statistics for equality of the common coefficient to the theoretical value.
  • p.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.methodmethod for p-values correction.
  • u.multcomptest statistics of pairwise comparisons.
  • p.multcompp-values of pairwise comparisons.
  • 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))
factor<-factor(rep(LETTERS[1:3],each=15))
cor.multcomp(var1,var2,factor)

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

Run the code above in your browser using DataLab