This function uses data on two column vectors, xi, xj, and a third set xk, which can be a vector or a matrix. xk usually has the remaining variables in the model, including control variables, if any. This function first removes missing data from all input variables. Then, it computes residuals of OLS (no kernel) regression (xi on xk) and (xj on xk). This hybrid version uses both OLS and then generalized correlation among OLS residuals. This solves the potential problem of having too little information content in kernel regression residuals, since kernel fits are sometimes too close, especially when there are many variables in xk.
parcorHijk(xi, xj, xk)
Generalized partial correlation Xi with Xj (=cause) after removing xk
Generalized partial correlation Xj with Xi (=cause) after removing xk
allowing for control variables.
Input vector of data for variable xi
Input vector of data for variable xj
Input data for all variables in xk, usually control variables
Prof. H. D. Vinod, Economics Dept., Fordham University, NY.
See parcor_ijk
.
if (FALSE) {
set.seed(34);x=matrix(sample(1:600)[1:99],ncol=3)
options(np.messages=FALSE)
parcorHijk(x[,1], x[,2], x[,3])
}#'
Run the code above in your browser using DataLab