Learn R Programming

generalCorr (version 1.2.6)

allPairs: Report causal identification for all pairs of variables in a matrix (deprecated function). It is better to choose a target variable and pair it with all others, instead of considering all possible targets.

Description

This studies all possible (perhaps too many) causal directions in a matrix. It is deprecated because it uses older criterion 1 by caling abs_stdapd I recommend using causeSummary or its block version cuseSummBlk. This uses abs_stdres, comp_portfo2, etc. and returns a matrix with 7 columns having detailed output. Criterion 1 has been revised as described in Vinod (2019) and is known to work better.

Usage

allPairs(mtx, dig = 6, verbo = FALSE, typ = 1, rnam = FALSE)

Value

A 7-column matrix called 'outcause' with names of variables X and Y in the first two columns and the name of the 'causal' variable in 3rd col. Remaining four columns report numerical computations of SD1 to SD4, r*(x|y), r*(y|x). Pearson r and p-values for its traditional significance testing.

Arguments

mtx

Input matrix with variable names

dig

Digits of accuracy in reporting (=6, default)

verbo

Logical variable, set to 'TRUE' if printing is desired

typ

Causal direction criterion number (typ=1 is default) Criterion 1 (Cr1) compares kernel regression absolute values of gradients. Criterion 2 (Cr2) compares kernel regression absolute values of residuals. Criterion 3 (Cr3) compares kernel regression based r*(x|y) with r*(y|x).

rnam

Logical variable, default rnam=FALSE means the user does not want the row names to be (somewhat too cleverly) assigned by the function.

Author

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

References

Vinod, H. D.'Generalized Correlation and Kernel Causality with Applications in Development Economics' in Communications in Statistics -Simulation and Computation, 2015, tools:::Rd_expr_doi("10.1080/03610918.2015.1122048")

Vinod, H. D. 'New exogeneity tests and causal paths,' Chapter 2 in 'Handbook of Statistics: Conceptual Econometrics Using R', Vol.32, co-editors: H. D. Vinod and C.R. Rao. New York: North Holland, Elsevier Science Publishers, 2019, pp. 33-64.

See Also

See Also somePairs, some0Pairs causeSummary

Examples

Run this code

data(mtcars)
options(np.messages=FALSE)
for(j in 1:3){
a1=allPairs(mtcars[,1:3], typ=j)
print(a1)}

Run the code above in your browser using DataLab