pcor | R Documentation |
Function calculates partial correlations between the provided variables
pcor(x, y = NULL, use = c("na.or.complete", "complete.obs", "everything",
"all.obs"), method = c("pearson", "spearman", "kendall"))
x |
Either data.frame or a matrix with numeric values. |
y |
The numerical variable. |
use |
What observations to use. See cor function for details.
The only option that is not available here is |
method |
Which method to use for the calculation of the partial correlations. This can be either Pearson's, Spearman's or Kendall's coefficient. See cor for details. |
The calculation is done based on multiple linear regressions. The function calculates them for each pair of variables based on the residuals of linear models of those variables from the other variables in the dataset.
The following list of values is returned:
value - Matrix of the coefficients of partial correlations;
p.value - The p-values for the parameters;
method - The method used in the calculations.
Ivan Svetunkov, ivan@svetunkov.com
mcor, cramer, association
pcor(mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.