Pearson product-moment correlations

Share:

Description

R implementation of the SPSS CORRELATIONS function.

Usage

1
2
3
4
5
6
7
8
xpssCorrelations(x,
               variables = NULL,
               miss = list(alternative = "pairwise",
                         missings = "exclude"),
               print = list(test = "twotail",
                       level = "sig"),
               matrix = NULL,
               statistics = NULL)

Arguments

x

a (non-empty) data.frame or input data of class "xpss-Frame".

variables

atomic character or character vektor with the name of the variables.

miss

method which indicates what should happen when the data contain NAs. Default for alternative is 'pairwise', optionally listwise can be used as treatment for missings. The visualisation of the NAs can be specied via the argument missings. Default is 'exclude', optionally 'include' can be chosen to add missings in the statistics.

print

method which indicates what significnace level shall be used. Default significance test is 'twotail', optionally 'onetail' can be chosen. Default significance level is 'sig' to add significance asterisks, optionally 'nosig'.

matrix

exports the correlation matrix with observations, stddevs, means and variable names. Default is NULL.

statistics

method which enumerate the deskriptive statistics. Default is NULL. Optionally 'descriptives', 'xprod' or 'all' can be chosen.

Details

xpssCorrelations produces Pearson product-moment correlations with significance levels and, optionally, univariate statistics, covariances, and cross-product deviations.

Value

Returns a matrix of Pearson's r correlation.

Author(s)

Benjamin Piest

See Also

cor cor.test rcorr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
data(fromXPSS)



xpssCorrelations (fromXPSS,
                 variables =c("V5","V6","V7_2"))



xpssCorrelations (fromXPSS,
                 variables =c("V5","V6","V7_2") ,
                 miss = list(alternative = "pairwise",
                                missings = "exclude"),
                 print = list(test = "onetail",
                              level = "sig"),
                 statistics="all")



xpssCorrelations (fromXPSS,
                 variables =c("V5","V6","V7_2") ,
                 miss = list(alternative = "pairwise",
                                missings = "include"),
                 print = list(test = "onetail",
                              level = "sig"),
                 statistics="all")



xpssCorrelations (fromXPSS,
                 variables =c("V5","V6","V7_2") ,
                 miss = list(alternative = "listwise",
                                missings = "exclude"),
                 print = list(test = "twotail",
                              level = "sig"),
                 statistics="all")



xpssCorrelations (fromXPSS,
                 variables =c("V5","V6","V7_2"),
                 statistics = "all",
                 matrix = paste0(getwd(),"/correlations.txt"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.