This function prints the correlation matrix of residuals of a model annotated with p-values. This is a lower triangular matrix, in the way that all elements in the upper triangular matrix are NA and the elementals on the "diagonal" are 1 (note that there is not really a diagonal because the matrix is rectangular). The odd rows of the returned matrix contain the correlations while the even rows are the associated p-values. For each correlation in row x, column y, its p-value is located in row x+1, column y.

print_correlation_matrix(varest)

Arguments

varest

A varest model.

Value

This function returns the annotated correlation matrix.

Examples

data_matrix <- matrix(nrow = 40, ncol = 3) data_matrix[, ] <- runif(ncol(data_matrix) * nrow(data_matrix), 1, nrow(data_matrix)) colnames(data_matrix) <- c('rumination', 'happiness', 'activity') varest <- autovarCore:::run_var(data_matrix, NULL, 1) autovarCore::print_correlation_matrix(varest)
#> #> Correlation matrix of residuals: #> rumination happiness activity #> rumination 1.000000000 NA NA #> p 0.000000000 NA NA #> happiness -0.047454313 1.00000000 NA #> p 0.774210528 0.00000000 NA #> activity 0.002537100 -0.01684111 1 #> p 0.987769952 0.91894880 0