The P_CORRELATE function computes the partial correlation coefficient of a dependent variable and one particular independent variable when the effects of all other variables involved are removed.
To compute the partial correlation, the following method is used:
This routine is written in the IDL language. Its source code can be found in the file
p_correlate.pro in the
lib subdirectory of the IDL distribution.
Result = P_CORRELATE( X, Y, C [, /DOUBLE] )
Returns the correlation coefficient.
An n-element integer, single-, or double-precision floating-point vector that specifies the independent variable data.
An n-element integer, single-, or double-precision floating-point vector that specifies the dependent variable data.
An integer, single-, or double-precision floating-point array that specifies the independent variable data whose effects are to be removed. C may either be an n-element vector containing the independent variable, or a p-by-n two-dimensional array in which each column corresponds to a separate independent variable.
Set this keyword to force the computation to be done in double-precision arithmetic.
; Define three sample populations: X0 = [64, 71, 53, 67, 55, 58, 77, 57, 56, 51, 76, 68] X1 = [57, 59, 49, 62, 51, 50, 55, 48, 52, 42, 61, 57] X2 = [ 8, 10, 6, 11, 8, 7, 10, 9, 10, 6, 12, 9] ; Compute the partial correlation of X0 and X1 with the effects ; of X2 removed. result = P_CORRELATE(X0, X1, X2) PRINT, result
A_CORRELATE, C_CORRELATE, CORRELATE, M_CORRELATE, R_CORRELATE