corr: Correlation Analysis

View source: R/corr.R

corrR Documentation

Correlation Analysis

Description

[Stable]

  • corr() estimates Pearson correlation coefficients among parametric numerical characteristics as follows:

  • ⁠The Pearson correlation coefficient:⁠ \loadmathjax \mjsdeqn r_x,y = \fracn\sumxy-(\sumx)(\sumy) \sqrt(n\sumx^2-(\sumx)^2)(n\sumy^2-(\sumy)^2)

or: \mjsdeqn r_x,y =\frac\Sigma(x-\barx)(y-\bary) \sqrt\Sigma(x-\barx)^2\Sigma(y-\bary)^2

where \mjseqnr_x,y is the ⁠correlation coefficient⁠ between \mjseqnx and \mjseqny variables.

Usage

corr(datap, verbose = FALSE)

Arguments

datap

The data set

verbose

If verbose = TRUE then some results are printed in the console.

Details

The corr() function estimates correlation coefficients and their significance in the form of a table of one or more independent (exogenous) variables on a dependent (endogenous) variable along with testing the significance.

Value

Returns a list of two objects:

Correlations

the data frame of Pearson's correlation coefficients

P_values

the data frame of significance of correlation coefficients (r):

  • p p-value for testing the r

  • lowCI lower confidence interval of r

  • uppCI upper confidence interval of r

Author(s)

Ali Arminian abeyran@gmail.com

See Also

correlation

Examples


data(dtsimp)
corr(dtsimp, verbose = FALSE)


data(dtraw)
corr(dtraw[, -1], verbose = FALSE)


Path.Analysis documentation built on Sept. 30, 2024, 9:25 a.m.