# parcorHijk2: Generalized partial correlation coefficients between Xi and... In generalCorr: Generalized Correlations, Causal Paths and Portfolio Selection

 parcorHijk2 R Documentation

## Generalized partial correlation coefficients between Xi and Xj,

### Description

The 2 in the name of the function means second version. The H in the function name means hybrid. This removes the effect of Xk, via OLS regression residuals. This function uses data on two column vectors, xi, xj, and a third set xk, which can be a vector or a matrix, usually of the remaining variables in the model, including control variables, if any. It first removes missing data from all input variables. Then, it computes residuals of OLS regression (xi on xk) and (xj on xk). The function reports the generalized correlation between two OLS residuals. This hybrid version uses both OLS and then generalized correlation among OLS residuals. This second version works when 'parcorVecH' fails. It is called by the function â€˜parcorVecH2â€™.

### Usage

``````parcorHijk2(xi, xj, xk)
``````

### Arguments

 `xi` Input vector of data for variable xi `xj` Input vector of data for variable xj `xk` Input data for variables in xk, usually control variables

### Value

 `ouij` Generalized partial correlation Xi with Xj (=cause) after removing xk `ouji` Generalized partial correlation Xj with Xi (=cause) after removing xk

allowing for control variables.

### Note

This function calls `kern`,

### Author(s)

Prof. H. D. Vinod, Economics Dept., Fordham University, NY.

See `parcor_ijk`.

### Examples

``````
## Not run:
set.seed(34);x=matrix(sample(1:600)[1:99],ncol=3)
options(np.messages=FALSE)
parcorHijk2(x[,1], x[,2], x[,3])

## End(Not run)#'
``````

generalCorr documentation built on May 1, 2023, 9:06 a.m.