Vector of hybrid generalized partial correlation coefficients.
Vector of hybrid generalized partial correlation coefficients.
This is a second version to be used when `parcorVecH' fails. (H=hybrid). This hybrid version of parcorVec subtracting only linear effects but using generlized correlation between OLS residuals
parcorVecH2(mtx, dig =4, verbo =FALSE, idep =1)
Arguments
mtx: Input data matrix with p (> or = 3) columns, first column must have the dependent variable
dig: The number of digits for reporting (=4, default)
verbo: Make this TRUE for detailed printing of computational steps
idep: The column number of the dependent variable (=1, default)
Returns
A p by 1 `out' vector containing hybrid partials r*(i,j | k).
Details
This function calls parcorHijk2 function which uses original data to compute generalized partial correlations between Xi, the dependent variable, and Xj which is the current regressor of interest. Note that j can be any one of the remaining variables in the input matrix mtx. Partial correlations remove the effect of variables Xk other than Xi and Xj. Calculation merges control variable(s) (if any) into Xk. Let the remainder effect from OLS regressions of Xi on Xk equal the residuals u(i,k). Analogously define u(j,k). It is a hybrid of OLS and generalized. Finally, partial correlation is generalized (kernel) correlation between u(i,k) and u(j,k).
Note
Hybrid Generalized Partial Correlation Coefficients (HGPCC) allow comparison of the relative contribution of each Xj to the explanation of Xi, because HGPCC are scale-free pure numbers.
We want to get all partial correlation coefficient pairs removing other column effects. Vinod (2018) shows why one needs more than one criterion to decide the causal paths or exogeneity.
Examples
set.seed(234)z=runif(10,2,11)# z is independently createdx=sample(1:10)+z/10#x is partly indep and partly affected by zy=1+2*x+3*z+rnorm(10)# y depends on x and z not vice versamtx=cbind(x,y,z)parcorVecH2(mtx)## Not run:set.seed(34);mtx=matrix(sample(1:600)[1:80],ncol=4)colnames(mtx)=c('V1','v2','V3','V4')parcorVecH2(mtx,verbo=TRUE, idep=2)## End(Not run)
Vinod, H. D. 'Matrix Algebra Topics in Statistics and Economics Using R', Chapter 4 in Handbook of Statistics: Computational Statistics with R, Vol.32, co-editors: M. B. Rao and C.R. Rao. New York: North Holland, Elsevier Science Publishers, 2014, pp. 143-176.