Learn R Programming

psycho (version 0.0.8)

correlation: Multiple Correlations.

Description

Compute different kinds of correlation matrices.

Usage

correlation(df, df2 = NULL, type = "full", method = "pearson",
  adjust = "holm")

Arguments

df

The dataframe

df2

Optional dataframe to correlate with the first one.

type

A character string indicating which correlation type is to be computed. One of "full" (default), "partial" or "semi" for semi-partial correlations.

method

A character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman" can be abbreviated.

adjust

What adjustment for multiple tests should be used? ("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"). See p.adjust for details about why to use "holm" rather than "bonferroni").

Value

output

Examples

Run this code
# NOT RUN {
df <- attitude

# Normal correlations
results <- psycho::correlation(df)
print(results)
plot(results)

# Partial correlations with correction
results <- psycho::correlation(df, type="partial",
                                   method="spearman",
                                   adjust="holm")
print(results)
plot(results)

# }

Run the code above in your browser using DataLab