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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cor.multcomp.R

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

1
2
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.test

a character string giving the name of the global test computed.

data.name

a character string giving the name(s) of the data.

statistic

test statistics.

parameter

test degrees of freedom.

p.value

p-value for comparison of the coefficients.

null.value

the value of the difference in coefficients under the null hypothesis, always 0.

alternative

a character string describing the alternative hypothesis.

estimate

the estimated correlation coefficients.

alpha

significance level.

conf.level

confidence level.

p.adjust.method

method for p-values correction.

p.value.multcomp

data frame of pairwise comparisons result.

common.name

a character string explaining the elements of the table below.

common

data frame of results if the coefficients are not significantly different (common coefficient).

Author(s)

Maxime Herv<e9> <[email protected]>

See Also

cor.test

Examples

1
2
3
4
5
6
7
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)

Example output

*** Package RVAideMemoire v 0.9-68 ***

	Comparison of 3 Pearson's linear correlation coefficients

data:  var1 and var2 by fact 
X-squared = 52.654, df = 2, p-value = 3.684e-12
alternative hypothesis: true difference in coefficients is not equal to 0 
sample estimates:
coeff in group A coeff in group B coeff in group C 
      -0.5716642        0.9794360        0.4296422 

        Pairwise comparisons 

          A         B
B 2.008e-12         -
C 6.576e-03 1.184e-05

P value adjustment method: fdr

	Comparison of 3 Pearson's linear correlation coefficients

data:  var1 and var3 by fact 
X-squared = 0.1056, df = 2, p-value = 0.9486
alternative hypothesis: true difference in coefficients is not equal to 0 
sample estimates:
coeff in group A coeff in group B coeff in group C 
       0.7499207        0.6927853        0.7456012 

        Common correlation coefficient, 95% confidence interval
          and equality to given value 0 

    inf      r    sup theoretical     U  Pr(>|U|)    
 0.5392 0.7304 0.8501           0 5.578 2.432e-08 ***

RVAideMemoire documentation built on May 14, 2018, 5:07 p.m.