computeCorrelation: Compute correlation

computeCorrelationR Documentation

Compute correlation

Description

Computes correlation matrix as well as corresponding p-values.

Usage

computeCorrelation(object, ...)

## S4 method for signature 'Correlation'
computeCorrelation(
  object,
  across = NULL,
  methods_corr = "pearson",
  verbose = TRUE,
  ...
)

## S4 method for signature 'Analysis'
computeCorrelation(
  object,
  across = NULL,
  across_subset = NULL,
  methods_corr = "pearson",
  verbose = TRUE
)

Arguments

object

Any object for whose class a method has been defined.

...

Additional arguments given to Hmisc::rcorr().

across

Character vector or NULL. If character, the name of the grouping variables that contain the group assignment across which analysis should be conducted. If NULL, no grouping is done.

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

Details

If argument across is NULL. All numeric variables are simply correlated.

If across is character: Prior to correlation, the data set is split into subsets for each group a grouping variable contains. Then the variables are correlated separately for each group. This is done for every grouping variable denoted in the input vector of across.

Results can be retrieved or visualized by specifying the grouping variable of interest in the across argument and the group(s) of interest with the across_subset argument of the respective function.

Computation is conducted with Hmisc::rcorr().

Value

The input object.


kueckelj/confuns documentation built on July 4, 2024, 4:53 p.m.