mag: Approximate overall magnitudes of kernel regression partials...

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/mag.R


Uses Vinod (2015) and runs kernel regression of x on y, and also of y on x by using the ‘np’ package. The function goes on to compute a summary magnitude of the overall approximate partial derivative dx/dy (and dy/dx), after adjusting for units by using an appropriate ratio of standard deviations. Of course, the real partial derivatives of nonlinear functions are generally distinct for each observation.


mag(x, y)



Vector of data on the dependent variable


Vector of data on the regressor


vector of two magnitudes of kernel regression partials dx/dy and dy/dx.


This function is intended for use only after the direction of causal path is already determined by various functions in this package (e.g. somePairs). For example, if the researcher knows that x causes y, then only dy/dx denoted by dydx is relevant. The other output of the function dxdy is to be ignored. Similarly, only ‘dxdy’ is relevant if y is known to be the cause of x.


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


Vinod, H. D. 'Generalized Correlation and Kernel Causality with Applications in Development Economics' in Communications in Statistics -Simulation and Computation, 2015,

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.

See Also

See mag_ctrl.


mag(x,y)#dxdy approx=.5 and dydx approx=2 will be nice.

generalCorr documentation built on July 22, 2017, 5:01 p.m.

Related to mag in generalCorr...