Learn R Programming

RVAideMemoire (version 0.9-6)

cor.2comp: Comparison of 2 Pearson's linear correlation coefficients

Description

Perform the test for equality of 2 Pearson's correlation coefficients. If difference is not significative, the function returns the common coefficient, its confidence interval and performs the test for equality to a given value.

Usage

cor.2comp(var1, var2, var3, var4, alpha = 0.05, conf.level = 0.95, theo = 0)

Arguments

var1
numeric vector (first variable of the first correlation).
var2
numeric vector (second variable of the first correlation).
var3
numeric vector (first variable of the second correlation).
var4
numeric vector (second variable of the second correlation).
alpha
significance level.
conf.level
confidence level.
theo
theoretical coefficient.

Value

  • conf.levelconfidence level.
  • alphasignificance level.
  • coeffsobserved Pearson's coefficients.
  • u.comptest statistics for comparison of the 2 coefficients.
  • p.comp-value for comparison of the 2 coefficients.
  • compdata.frame of results for comparison or the 2 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 or results for equality of the common coefficient to the theoretical value.

See Also

cor.test

Examples

Run this code
cor1.var1<-1:30+rnorm(30,0,2)
cor1.var2<-1:30+rnorm(30,0,3)
cor2.var1<-(-1):-30+rnorm(30,0,2)
cor2.var2<-(-1):-30+rnorm(30,0,3)
cor.2comp(cor1.var1,cor1.var2,cor2.var1,cor2.var2)

Run the code above in your browser using DataLab