Learn R Programming

generalCorr (version 1.2.0)

stdres: Residuals of kernel regressions of x on y when both x and y are standardized.

Description

1) Standardize the data to force mean zero and variance unity, 2) kernel regress x on y, with the option `residuals = TRUE' and finally 3) compute the residuals.

Usage

stdres(x, y)

Arguments

x

vector of data on the dependent variable

y

data on the regressors which can be a matrix

Value

kernel regression residuals are returned after standardizing the data on both sides so that the magnitudes of residuals are comparable between regression of x on y on the one hand and regression of y on x on the other.

Details

The first argument is assumed to be the dependent variable. If stdres(x,y) is used, you are regressing x on y (not the usual y on x). The regressors can be a matrix with 2 or more columns. The missing values are suitably ignored by the standardization.

References

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

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
set.seed(330)
x=sample(20:50)
y=sample(20:50)
stdres(x,y)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab