Library: | robtech |
See also: | l1fit lts mve |
Quantlet: | rdl1 | |
Description: | Computes RDL1 estimate --- a weighted L1-estimator of y on on continuous variables x and binary variables xdum with weights min(1, p/(RD^2)); RD contains the robust distances obtained by the MVE estimator for x. |
Usage: | z = rdl1(x,xdum,y) | |
Input: | ||
x | n x p1 matrix of continuous explanatory variables. | |
xdum | n x p2 matrix of binary explanatory variables (including intercept if required). | |
y | n x 1 vector, dependent variable. | |
Output: | ||
z.coefs | (p1+p2) x 1 vector of the estimated regression parameters. | |
z.weight | n x 1 vector of the robust weights used in L1 regression. | |
z.res | n x 1 vector of the regression residuals. | |
z.scale | a robust estimate of scale (median absolute deviation). | |
z.stres | n x 1 vector of the standardized regression residuals. |
library("robtech") randomize(101) n = 100 x = normal(n) xdum = matrix(n)~rint(uniform(n)) y = 5 + 2*x - xdum[,2] + normal(n) ; compute the estimate z = rdl1(x, xdum, y) z.coefs
Contents of coefs - estimates of b = (2,5,-1)' coefficient vector (coefficient 2 corresponds to the only continuous variable x, coefficients 5 and -1 to the binary variables - intercept and xdum) [1,] 2.2634 [2,] 5.0839 [3,] -0.9755