A straightforward application of matrix algebra to remove the effect of the variables in the y set from the x set. Input may be either a data matrix or a correlation matrix. Variables in x and y are specified by location.
partial.r(m, x, y)
A data or correlation matrix
The variable numbers associated with the X set.
The variable numbers associated with the Y set
It is sometimes convenient to partial the effect of a number of variables (e.g., sex, age, education) out of the correlations of another set of variables. This could be done laboriously by finding the residuals of various multiple correlations, and then correlating these residuals. The matrix algebra alternative is to do it directly.
To find the confidence intervals and "significance" of the correlations, use the
corr.p function with n = n - s where s is the numer of covariates.
The matrix of partial correlations.
Revelle, W. (in prep) An introduction to psychometric theory with applications in R. To be published by Springer. (working draft available at http://personality-project.org/r/book/
mat.regress for a similar application for regression
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.