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 (2022).
Usage
rcorr.test(x, plot = TRUE, var.names = NULL, scale.font = 1)
Arguments
x |
A numeric matrix or a multivariate numeric time series object (ts, xts, zoo) or a data frame. |
plot |
Logical. If TRUE the sample Pearson correlations and the p-values for significance are plotted. 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 |
varnames |
The variable names used in the plot/table. |
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. (2022). "Robust Tests for White Noise and Cross-Correlation". Econometric Theory, 38(5), 913-941, doi:10.1017/S0266466620000341. Cowles Foundation, Discussion Paper No. 2194RS, https://elischolar.library.yale.edu/cowles-discussion-paper-series/57/.
Giraitis, L., Li, Y. and Phillips, P. C. B. (2024). "Robust Inference on Correlation under General Heterogeneity". Journal of Econometrics, 244(1), 105691, doi:10.1016/j.jeconom.2024.105691.
Examples
x <- matrix(rnorm(400), 100)
rcorr.test(x)