partial.corr | R Documentation |
The partial correlation of x and y conditioning on z is the ordinary correlation of the residuals from the regression of x on z and the regression of y on z.
partial.corr(vars, cond)
vars |
matrix of data.frame of all the variables to be correlated. |
cond |
matrix of data.frame of all the variables to be conditioned on. |
matrix of partial correlations of the numeric variables in the argument
vars
conditioning on the numeric variables in cond
.
Richard M. Heiberger <rmh@temple.edu>
if.R(r=
partial.corr(longley[,1:3], longley[,4:6])
,s=
partial.corr(longley.x[,1:3], longley.x[,4:6])
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.