Learn R Programming

generalCorr (version 1.2.6)

mag: Approximate overall magnitudes of kernel regression partials dx/dy and dy/dx.

Description

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.

Usage

mag(x, y)

Value

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

Arguments

x

Vector of data on the dependent variable

y

Vector of data on the regressor

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. '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.

Examples

Run this code

set.seed(123);x=sample(1:10);y=1+2*x+rnorm(10)
mag(x,y)#dxdy approx=.5 and dydx approx=2 will be nice.

Run the code above in your browser using DataLab