rcorr.test {testcorr}R Documentation

Testing zero Pearson correlation

Description

The function rcorr.test computes the test statistics for examining the null hypothesis of zero Pearson correlation for multivariate series in Dalla, Giraitis and Phillips (2020).

Usage

rcorr.test(x, plot = TRUE, table = TRUE, var.names = NULL,
           scale.font = 1)

Arguments

x

A numeric matrix or a multivariate numeric time series object or a data frame.

plot

Logical. If TRUE the sample Pearson correlations and the p-values for significance are plotted. Default is TRUE.

table

Logical. If TRUE the sample Pearson correlations and the p-values for significance are printed out. Default is TRUE.

var.names

NULL or a character string specifying the variable names. If NULL and x has names, the names of x are used. If NULL and x has no names, the string c("x[1]","x[2]",...) is used. Default is NULL.

scale.font

A positive number indicating the scaling of the font size in the plots. Default is 1.

Details

The p-value of the robust \widetilde{t} statistic is for testing the null hypothesis H_0:\rho_{i,j}=0, where \rho_{i,j} denotes the correlation of x_{i} and x_{j}.

Value

An object of class "rcorr.test", which is a list with the following components:

pc

The sample Pearson correlations.

pv

The p-values for the \widetilde{t} test statistics.

Note

Missing values are not allowed.

Author(s)

Violetta Dalla, Liudas Giraitis and Peter C. B. Phillips

References

Dalla, V., Giraitis, L. and Phillips, P. C. B. (2020). "Robust Tests for White Noise and Cross-Correlation". Cowles Foundation, Discussion Paper No. 2194, https://cowles.yale.edu/sites/default/files/files/pub/d21/d2194-r.pdf.

Examples

x <- matrix(rnorm(400),100)
rcorr.test(x)

[Package testcorr version 0.2.0 Index]