lm()
have adopted.getPartialCor(model, dvonly = TRUE)
To students. 1) This gives the same result as the function
cov2pcor
in gRbase
, so far as I can tell. Why use
this? Simply for convenenience. We have found that installing
gRbase is a problem because it depends on packages in
Bioconductor. 2) By default, I show only one column of output,
the partial correlations involving the dependent variable as
something being explained. The other columns that would depict the
dependent variable as a predictor of the independent variables
have been omitted. You can let me know if you think that's wrong.
Please note I have not gone out of my way to make this calculation "numerically stable." It does not use any orthogonal matrix calculations; it is using the same textbook theoretical stats formula that is used by cov2pcor in gRbase and in every other package or online source I could find. I prepared a little WorkingExample file matrix-partial-correlations-1.R that discusses this, in case you are interested (http://pj.freefaculty.org/R).