| corrMatrix {jmv} | R Documentation |
Correlation Matrix
corrMatrix(data, vars, pearson = TRUE, spearman = FALSE, kendall = FALSE, sig = TRUE, flag = FALSE, ci = FALSE, ciWidth = 95, plots = FALSE, plotDens = FALSE, plotStats = FALSE, hypothesis = "corr")
data |
the data as a data frame |
vars |
a vector of strings naming the variables to correlate in
|
pearson |
|
spearman |
|
kendall |
|
sig |
|
flag |
|
ci |
|
ciWidth |
a number between 50 and 99.9 (default: 95), the width of confidence intervals to provide |
plots |
|
plotDens |
|
plotStats |
|
hypothesis |
one of |
A results object containing:
results$matrix | a correlation matrix table | ||||
results$plot | a correlation matrix plot | ||||
Tables can be converted to data frames with asDF or as.data.frame. For example:
results$matrix$asDF
as.data.frame(results$matrix)
## Not run:
data('mtcars')
corrMatrix(mtcars, vars = c('mpg', 'cyl', 'disp', 'hp'))
#
# CORRELATION MATRIX
#
# Correlation Matrix
# --------------------------------------------------------------
# mpg cyl disp hp
# --------------------------------------------------------------
# mpg Pearson's r — -0.852 -0.848 -0.776
# p-value — < .001 < .001 < .001
#
# cyl Pearson's r — 0.902 0.832
# p-value — < .001 < .001
#
# disp Pearson's r — 0.791
# p-value — < .001
#
# hp Pearson's r —
# p-value —
# --------------------------------------------------------------
#
## End(Not run)