Learn R Programming

translateSPSS2R (version 1.0.0)

xpssCorrelations: Pearson product-moment correlations

Description

R implementation of the SPSS CORRELATIONS function.

Usage

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.

Value

Returns a matrix of Pearson's r correlation.

Details

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

See Also

cor cor.test rcorr

Examples

Run this code
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"))

Run the code above in your browser using DataLab