corTable: Correlation matrix table.

Description Usage Arguments Value Examples

Description

Produces a simple correlation matrix table.

Usage

1
corTable(data, use = "pairwise", method = "pearson", round = 2, significance = NA, sd = FALSE, mean.sd.cols = FALSE)

Arguments

data

data.frame containing the variables for which the correlation matrix should be calculated.

use

Which observations should be used? use="pairwise" is the default value and will do pairwise deletion of cases. use="complete" will select just complete cases.

method

Which correlation type should be used? method="pearson" is the default value. The alternatives to be passed to cor are "spearman" and "kendall".

round

numeric values that denotes to what decimal point should be rounded.

significance

character vector that specifies if p-values and/or significance stars should be included in the table. ="NA" displays no significances. ="stars" displays significance stars. ="p-values" displays p-values and =c("stars", "p-values") displays both stars and p-values.

sd

logical value that toggles Whether the standard deviation should be displayed in the diagonal.

mean.sd.cols

logical value that toggles Whether additional mean and standard columns should be included in the table.

Value

A dataframe comprising the correlation matrix table.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(myData)
corTable(myData[,1:4])
corTable(myData[,1:4], method = "kendall")
corTable(myData[,1:4], sd = TRUE)
corTable(myData[,1:4], use = "complete")
corTable(myData[,1:4], significance = "stars")
corTable(myData[,1:4], significance = c("stars", "p-values"))
corTable(myData[,1:4], round = 4)
corTable(myData[,1:4], mean.sd.cols = TRUE)
(cor.tab <- corTable(myData[,1:4], significance = "stars", mean.sd.cols = TRUE))

#saveTable(cor.tab, "corTab.rtf")

psytabs documentation built on May 2, 2019, 5:27 p.m.