LAD: Least Absolute Deviance Estimator for Linear Regression

Description Usage Arguments Value Examples

View source: R/LAD.R

Description

Least Absolute Deviance Estimator for Linear Regression

Usage

1
LAD(y, X, intercept = FALSE)

Arguments

y

reponse vector

X

design matrix

intercept

logical input that indicates if intercept needs to be estimated. Default is FALSE.

Value

coefficient estimates

Examples

1
2
3
4
5
6
7
8
set.seed(1989)
n=200; d=4
X=matrix(rnorm(n*d), nrow=n, ncol=d)
beta=c(1, -1, 2, -2)
y=-2+X%*%beta+c(rnorm(150), rnorm(30,10,10), rnorm(20,0,100))
beta.ls=lm(y~X)$coeff
beta.MTE=LAD(y,X,intercept=TRUE)
cbind(c(-2,beta), beta.ls, beta.MTE)

MTE documentation built on May 2, 2019, 5:57 a.m.

Related to LAD in MTE...