# partial.r: Find the partial correlations for a set (x) of variables with...

### Description

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.

### Usage

 `1` ```partial.r(m, x, y) ```

### Arguments

 `m` A data or correlation matrix `x` The variable numbers associated with the X set. `y` The variable numbers associated with the Y set

### Details

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.

### Value

The matrix of partial correlations.

William Revelle

### References

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

### Examples

 ```1 2 3 4 5``` ```jen <- make.hierarchical() #make up a correlation matrix round(jen[1:5,1:5],2) par.r <- partial.r(jen,c(1,3,5),c(2,4)) cp <- corr.p(par.r,n=98) #assumes the jen data based upon n =100. print(cp,short=FALSE) #show the confidence intervals as well ```

Search within the psych package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.