Skip to main content

Summary of a correlation analysis

Description

Characteristics of the analysis (mode, method, covariates, engines, confidence intervals, adjustment of the p-values), the variables and their types, the number of pairs and of significant pairs, the strongest pairs, and the content of the object.

Usage

## S3 method for class 'cor_result'
summary(object, top = 5, alpha = 0.05, ...)

Arguments

object output of cor_compute()
top number of strongest pairs to list
alpha significance threshold used in the counts
… unused

Value

object of class summary.cor_result: list(settings, variables, pairs, strongest, contents), printed by print()

Examples

library("corrkit")

d <- simulate_cor_data(150)
summary(cor_compute(d, c("CRP", "IL6", "BDNF", "NfL", "BIN_CRP"), labels = attr(d, "labels")))
== Correlation analysis (cor_result) ==

  Mode         matrix: every pair of 5 variables
  Method       Spearman
  Covariates   none (unadjusted)
  Engine       psych::corr.test() {psych}
  CI           95% (correlation::cor_to_ci)
  p-values     raw (no multiple-testing adjustment)

-- Variables --
 variable    label   role       type   n
      CRP      CRP matrix continuous 146
      IL6     IL-6 matrix continuous 146
     BDNF     BDNF matrix continuous 146
      NfL      NfL matrix continuous 146
  BIN_CRP CRP high matrix     binary 146

-- Pairs --
  10 pairs (4 involving a binary variable), N = 142–146
  p < 0.05: 4 (raw)

-- Strongest pairs (|r_s|) --
            pair   r_s             CI       p   n
  CRP - CRP high  0.87   [0.82, 0.90] < 0.001 146
      CRP - IL-6  0.41   [0.26, 0.54] < 0.001 142
 IL-6 - CRP high  0.30   [0.14, 0.45] < 0.001 142
     IL-6 - BDNF -0.23 [-0.38, -0.06]   0.007 142
      CRP - BDNF -0.14  [-0.30, 0.03]   0.099 142

-- Content of the object --
  $table  one row per pair (10 x 13): X, Y, x_type, y_type, r, ci_low, ci_high, p, p_adj, n, k, engine, ci_engine
  $meta   settings of the analysis (mode, meth, p_adjust, adjust_by, family, covariates, partial, k, x_vars, y_vars, x_types, y_types, labels, bin_mark, ci, engine, ci_engine)
  $data   the 5 columns used (150 rows)
  Use: plot(x, type = "heatmap" | "forest" | "scatter"), tbl_cor(x, layout = ...),
       as.matrix(x, what = "r" | "p" | "p_adj" | "n" | "ci_low" | "ci_high"), as.data.frame(x)
Back to top