[R] significance levels for partial correlations?
Ashish Ranpura
buddhahead at ranpura.com
Tue Nov 20 12:48:05 CET 2007
I've seen that this question has been asked before, in the archives,
but I haven't been able to find a workable answer. This may be a
failure to understand the statistics!
The problem is that, while I can easily get partial correlation
values out of corpcor, how do I get significance values? Surely the
significance of a partial correlation between two variables isn't the
same as the simple bivariate correlation significance (cor.test)? As
I said, I may be misunderstanding the stats.
And just to round out the scenario, I should mention that I've
written a function that uses the corpcor library to perform partial
correlations on "experimental" variables while partialing out the
effect of "control" variables (as opposed to getting the partial
correlation of a single variable controlling for ALL other
variables). This is just a convenience function that allows me to
stick in a whole data frame and analyze only those variables I'm
interested in.
I won't paste in that function here, it's not relevant to the
problem, but if anyone wants a copy just let me know. Here is the
syntax:
pcor.n = function (df, cont, expi="") {
###
## Perform an n-order partial correlation, controlling for the
influence of
## control variables on experimental ones.
##
## df data frame containing all the variables.
## cont a list of control variable names (list of strings)
## expi a list of experimental variable names (list of strings).
## (defaults to all variables excluding controls)
##
## RETURN VALUES
## The function returns a matrix of partial correlation values,
excluding the
## effects of the control variables.
##
###
Thanks for any guidance,
-Ashish Ranpura.
-----
Ashish Ranpura
Institute of Cognitive Neuroscience
University College London
17 Queen Square
London WC1N 3AR
tel: +44 (20) 7679 1126
web: http://www.icn.ucl.ac.uk
More information about the R-help
mailing list