Learn R Programming

generalCorr (version 1.2.0)

parcorVecH: Vector of hybrid generalized partial correlation coefficients, hybrid version of parcorVec subtracting only linear effects but using generlized correlation between OLS residuals

Description

This function calls parcor_ijk function which uses original data to compute generalized partial correlations between \(X_i\), the dependent variable, and \(X_j\) 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 \(X_k\) other than \(X_i\) and \(X_j\). Calculation merges control variable(s) (if any) into \(X_k\). Let the remainder effect from OLS regressions of \(X_i\) on \(X_k\) 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).

Usage

parcorVecH(mtx, ctrl = 0, dig = 4, verbo = FALSE, idep = 1)

Arguments

mtx

Input data matrix with p (> or = 3) columns, first column must have the dependent variable

ctrl

Input vector or matrix of data for control variable(s), default is ctrl=0 when control variables are absent

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)

Value

A p by 1 `out' vector containing hybrid partials r*(i,j | k).

References

Vinod, H. D. 'Generalized Correlations and Instantaneous Causality for Data Pairs Benchmark,' (March 8, 2015) https://www.ssrn.com/abstract=2574891

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.

Vinod, H. D. 'New Exogeneity Tests and Causal Paths,' (June 30, 2018). Available at SSRN: https://www.ssrn.com/abstract=3206096

Vinod, H. D. (2021) 'Generalized, Partial and Canonical Correlation Coefficients' Computational Economics, 59(1), 1--28.

See Also

See Also parcor_ijk.

See Also parcorVec.

Examples

Run this code
# NOT RUN {
set.seed(234)
z=runif(10,2,11)# z is independently created
x=sample(1:10)+z/10  #x is partly indep and partly affected by z
y=1+2*x+3*z+rnorm(10)# y depends on x and z not vice versa
mtx=cbind(x,y,z)
parcorVecH(mtx)
 
   
# }
# NOT RUN {
set.seed(34);mtx=matrix(sample(1:600)[1:80],ncol=4)
colnames(mtx)=c('V1', 'v2', 'V3', 'V4')
parcorVecH(mtx,verbo=TRUE, idep=2)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab