Description Usage Arguments Details Value Note Author(s) References See Also Examples
The function pcor
can calculate the pairwise partial correlations for each pair of variables given others. In addition, it gives us the p value as well as statistic for each pair of variables.
1 |
x |
a matrix or data fram. |
method |
a character string indicating which partial correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman" can be abbreviated. |
Partial correlation is the correlation of two variables while controlling for a third or more other variables. When the determinant of variance-covariance matrix is numerically zero, Moore-Penrose generalized matrix inverse is used. In this case, no p-value
and statistic
will be provided if the number of variables are greater than or equal to the sample size.
estimate |
a matrix of the partial correlation coefficient between two variables |
p.value |
a matrix of the p value of the test |
statistic |
a matrix of the value of the test statistic |
n |
the number of samples |
gn |
the number of given variables |
method |
the correlation method used |
Missing values are not allowed.
Seongho Kim <biostatistician.kim@gmail.com>
Kim, S. (2015) ppcor: An R Package for a Fast Calculation to Semi-partial Correlation Coefficients. Communications for Statistical Applications and Methods, 22(6), 665-674.
1 2 3 4 5 6 7 8 9 10 |
Loading required package: MASS
$estimate
hl disp deg BC
hl 1.0000000 -0.6720863 -0.6161163 0.1148459
disp -0.6720863 1.0000000 -0.7215522 0.2855420
deg -0.6161163 -0.7215522 1.0000000 0.6940953
BC 0.1148459 0.2855420 0.6940953 1.0000000
$p.value
hl disp deg BC
hl 0.00000000 0.06789202 0.10383620 0.78654997
disp 0.06789202 0.00000000 0.04332869 0.49299871
deg 0.10383620 0.04332869 0.00000000 0.05615021
BC 0.78654997 0.49299871 0.05615021 0.00000000
$statistic
hl disp deg BC
hl 0.0000000 -2.2232666 -1.916030 0.2831875
disp -2.2232666 0.0000000 -2.552768 0.7298173
deg -1.9160295 -2.5527682 0.000000 2.3617433
BC 0.2831875 0.7298173 2.361743 0.0000000
$n
[1] 10
$gp
[1] 2
$method
[1] "pearson"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.