This function is used to fit linear models considering Laplace errors.
lad(formula, data, method = c("BR", "EM"), subset, na.action,
control, model = TRUE, x = FALSE, y = FALSE, contrasts = NULL)an object of class lad representing the linear model fit. Generic
function print, show the results of the fit.
The functions print and summary are used to obtain and print a summary
of the results. The generic accessor functions coefficients, fitted.values
and residuals extract various useful features of the value returned by lad.
an object of class "formula": a symbolic description of
the model to be fitted.
an optional data frame containing the variables in the model. If
not found in data, the variables are taken from environment(formula),
typically the environment from which lad is called.
character string specifying the algorithm to use. The default
algorithm is the Barrodale and Roberts algorithm method = "BR". Other
possible value is method = "EM" for an EM algorithm using IRLS.
an optional expression indicating the subset of the rows of data that should be used in the fit.
a function that indicates what should happen when the data contain NAs.
a list of control values for the estimation algorithm to replace
the default values returned by the function l1pack.control.
logicals. If TRUE the corresponding components of
the fit (the model frame, the model matrix, the response) are returned.
an optional list. See the contrasts.arg of model.matrix.default.
The design was inspired by the R function lm.
Barrodale, I., and Roberts, F.D.K. (1974). Solution of an overdetermined system of equations in the L1 norm. Communications of the ACM 17, 319-320.
Phillips, R.F. (2002). Least absolute deviations estimation via the EM algorithm. Statistics and Computing 12, 281-285.
fm <- lad(stack.loss ~ ., data = stackloss, method = "BR")
summary(fm)
Run the code above in your browser using DataLab