fancyCorr: Function for creating nicely-formatted correlation matrices.

Description Usage Arguments Details Examples

Description

fancyCorr creates nicely-formatted correlation matrices.

Usage

1
2
3
fancyCorr(data, digits = 2, p.digits = 3, listwise = T, p.adj = F,
  sd.on.diag = T, p.on.upper = T, stars = F, star.thresholds = c(0.05,
  0.01, 0.001))

Arguments

data

Data frame containing the variables to be included in the matrix.

digits

The number of decimals to which the correlation coefficeents and standard deviations (if applicable) should be printed. Defaults to 2.

p.digits

The number of decimals to which the p-values should be printed. Defaults to 3.

listwise

Logical; should all rows containing missing data be removed? Defaults to TRUE.

p.adj

Logical; should the p-values be adjusted for multiple comparisons? Defaults to FALSE.

sd.on.diag

Logical; should the diagonal be replaced with standard deviations? Defaults to TRUE.

p.on.upper

Should p-values for the correlations be printed on the upper triangle? Defaults to TRUE.

stars

Should statistically significant correlation coefficients be starred? Defaults to FALSE.

star.thresholds

A vector of three values corresponding to p-value thresholds that should receive one, two, or three stars. Only operative if stars=TRUE. Defaults to c(.05, .01, .001).

Details

This function creates correlation matrices. Created as a mercy to my PSYC 5410 students.

Examples

1
2
3
4
5
set.seed(110)
data <- data.frame(matrix(rnorm(50), ncol=5))
fancyCorr(data)
fancyCorr(data, digits=3, p.digits=3, listwise=F, sd.on.diag=F, 
  p.adj=F, stars=T, star.thresholds=c(0,0,.1), p.on.upper=F)

mcbeem/fancyCorr documentation built on May 23, 2019, 2:50 p.m.