P_CORRELATE

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.

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.

Calling Sequence

Result = P_CORRELATE( X, Y, C )

Arguments

X

An n -element integer, single-, or double-precision floating-point vector that specifies the independent variable data.

Y

An n -element integer, single-, or double-precision floating-point vector that specifies the dependent variable data.

C

An integer, single-, or double-precision floating-point array that specifies the independent variable data whose effects are to be removed. The columns of this two-dimensional array correspond to the n -element vectors of independent variable data.

Examples

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]

result = P_CORRELATE(X0, X1, REFORM(X2, 1, N_ELEMENTS(X2)))
; Compute the partial correlation of X0 and X1 with the effects of X2 removed.

The result should be 0.533469.

See Also

A_CORRELATE , CORRELATE , C_CORRELATE , M_CORRELATE , R_CORRELATE