dicosar: Testing the equality of Pearson correlation coefficients...

View source: R/dicosar.R

dicosarR Documentation

Testing the equality of Pearson correlation coefficients between two groups

Description

These are further details.

Usage

dicosar(x1, x2, delta = FALSE, solver = FALSE)

Arguments

x1

an N1 by P matrix, in which N1 is the number of samples in the first group, and P is the number of variables. If P>2, tests will be run pairwisely.

x2

an N2 by P matrix, in which N2 is the number of samples in the second group.

delta

a logical value. If TRUE, the p-value from the Delta method will also be returned when P=2.

solver

FALSE by default. If solver=TRUE, BBsolve will be used to solve the saddlepoint equations when multiroot fails to converge. Note that BBsolve is much slower than multiroot.

Value

r1: The Pearson correlation coefficient of x1.

r2: The Pearson correlation coefficient of x2.

p: The p-value of the test for the equality of Pearson correlation coefficients using DICOSAR.

code: More information about the convergence, optimization, etc. A negative value indicates a problem. See details.

p_delta: The p-value of the test for the equality of Pearson correlation coefficients using the Delta method.

p_global: A p-value of the global test for the equality of two correlation matrices for each pair of the P variables in the input data. Only returned when P>2.

The value of code

1

No issue found.

-2

Sample size is too small and NA returned.

-3

Too many identical values and NA returned.

-4

At least one of the PCCs is one and NA returned.

-5

The algorithm in DICOSAR does not converge.

2 or 3

The algorithm converges, but the simplified version of DICOSAR (i.e., the first-order approximation of the signed root of the likelihood ratio statistic) is used.

Examples

library(dicosar)
n = 100
x1 = matrix(rnorm(2*n),nrow=n)
x2 = matrix(rnorm(2*n),nrow=n)
dicosar(x1,x2)


lhe17/dicosar documentation built on Sept. 27, 2022, 8:09 a.m.