# cor.2comp: Comparison of 2 Pearson's linear correlation coefficients In RVAideMemoire: Testing and Plotting Procedures for Biostatistics

## Description

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

## Usage

 `1` ```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

 `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. `p.value` p-value for comparison of the 2 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. `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]>

`cor.test`

## Examples

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

### Example output

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

Comparison of 2 Pearson's linear correlation coefficients

data:  4 variables
U = 1.132, p-value = 0.2576
alternative hypothesis: true difference in coefficients is not equal to 0
sample estimates:
coeff in group 1 coeff in group 2
0.9136586        0.9524312

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

inf      r    sup theoretical     U  Pr(>|U|)
0.893 0.9358 0.9618           0 12.52 6.066e-36 ***
```

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