Learn R Programming

RVAideMemoire (version 0.9-45-2)

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

Description

Performs 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 ofp.adjust.

Value

  • method.testa character string giving the name of the global test computed.
  • data.namea character string giving the name(s) of the data.
  • statistictest statistics.
  • parametertest degrees of freedom.
  • p.valuep-value for comparison of the coefficients.
  • null.valuethe value of the difference in coefficients under the null hypothesis, always 0.
  • alternativea character string describing the alternative hypothesis.
  • estimatethe estimated correlation coefficients.
  • alphasignificance level.
  • conf.levelconfidence level.
  • p.adjust.methodmethod for p-values correction.
  • p.value.multcompdata frame of pairwise comparisons result.
  • common.namea character string explaining the elements of the table below.
  • commondata frame of results if the coefficients are not significantly different (common coefficient).

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