LAD: Least Absolute Deviance Estimator for Linear Regression

View source: R/LAD.R

LADR Documentation

Least Absolute Deviance Estimator for Linear Regression

Description

Least Absolute Deviance Estimator for Linear Regression

Usage

LAD(X, y, intercept = FALSE)

Arguments

X

design matrix

y

reponse vector

intercept

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

Value

coefficient estimates

Examples

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.LAD=LAD(X,y,intercept=TRUE)
cbind(c(-2,beta), beta.ls, beta.LAD)


MTE documentation built on April 11, 2023, 6:11 p.m.

Related to LAD in MTE...