Skip to contents

Usage

jcorrelation(
  data,
  vars,
  group = NULL,
  method = "pearson",
  alternative = "two.sided",
  ci = TRUE,
  ciWidth = 95,
  flag = TRUE,
  flagAlpha = 0.05,
  plots = TRUE,
  plotType = "matrix",
  report = TRUE
)

Arguments

data

The data as a data frame.

vars

A vector of strings naming the variables to correlate.

group

Variable to split the analysis by.

method

The correlation method to use: 'pearson' (default), 'spearman', or 'kendall'.

alternative

The alternative hypothesis: 'two.sided' (default), 'greater', or 'less'.

ci

TRUE (default) or FALSE, provide confidence intervals.

ciWidth

Confidence interval level (default: 95\

flagTRUE (default) or FALSE, flag significant correlations.

flagAlphaAlpha level for flagging significant correlations (default: 0.05).

plotsTRUE (default) or FALSE, provide correlation plots.

plotTypeType of correlation plot: 'matrix' (default), 'pairs', or 'network'.

reportTRUE (default) or FALSE, provide natural language interpretation.

A results object containing:

results$matrixcorrelation matrix with significance tests
results$testsdetailed correlation tests for each pair of variables
results$summarysummary of correlation analysis
results$reporta html
results$plotan image
results$plotMatrixan image
results$plotPairsan image
results$plotNetworkan image
Tables can be converted to data frames with asDF or as.data.frame. For example:results$matrix$asDFas.data.frame(results$matrix) Comprehensive correlation analysis including Pearson, Spearman, and Kendall correlations with significance tests, confidence intervals, and natural language reporting. Suitable for exploring relationships between continuous variables. # Basic correlation analysis jcorrelation( data = histopathology, vars = c("Age", "OverallTime", "MeasurementA", "MeasurementB") )# With grouping variable jcorrelation( data = histopathology, vars = c("Age", "OverallTime", "MeasurementA"), group = "Sex" )