grplars(x, ...) ## S3 method for class 'formula':
grplars(formula, data, ...)
## S3 method for class 'data.frame':
grplars(x, y, ...)
## S3 method for class 'default':
grplars(x, y, sMax = NA, assign,
fit = TRUE, s = c(0, sMax), crit = c("BIC", "PE"),
splits = foldControl(), cost = rmspe,
costArgs = list(), selectBest = c("hastie", "min"),
seFactor = 1, ncores = 1, cl = NULL, seed = NULL,
model = TRUE, ...)
rgrplars(x, ...)
## S3 method for class 'formula':
rgrplars(formula, data, ...)
## S3 method for class 'data.frame':
rgrplars(x, y, ...)
## S3 method for class 'default':
rgrplars(x, y, sMax = NA, assign,
centerFun = median, scaleFun = mad, regFun = lmrob,
regArgs = list(),
combine = c("min", "euclidean", "mahalanobis"),
const = 2, prob = 0.95, fit = TRUE, s = c(0, sMax),
crit = c("BIC", "PE"), splits = foldControl(),
cost = rtmspe, costArgs = list(),
selectBest = c("hastie", "min"), seFactor = 1,
ncores = 1, cl = NULL, seed = NULL, model = TRUE, ...)
as.data.frame) containing the variables in
the model. If not found in data, the variables are taken
from NA (the
default), predictor groups are sequenced as long as there
are twice as many observations as expected predictor
variables (number of predictor groups tmedian).mad).lmrob).regFun."min" for taking the minimum weight for each
observation, "euclidean" for wTRUE, the default) or to
simply return the sequence (FALSE)."BIC" for the Bayes
information criterion and "PE" for
resampling-based prediction error estimation.perry).perry for some requirements).
The default is to use the root trimmed mean squared
prediction error for a robust fit and the root mean
squared prediccost.perrySelect). The default is to use
a one-standard-error rule.NA, all available processor cores are used. For
obtaining the data cleaning weighmakeCluster.
This is preferred over ncores for tasks that are
parallelized on the Rlevel, in which case .Random.seed). This is
useful because many robust regression functions
(including lmrobfit is FALSE, an integer vector
containing the indices of the sequenced predictor groups. Else if crit is "PE", an object of class
"perrySeqModel" (inheriting from classes
"perryTuning", see
perryTuning). It contains
information on the prediction error criterion, and
includes the final model as component finalModel.
Otherwise an object of class "grplars" (inheriting
from class "seqModel") with the following
components:
"bicSelect"
containing the BIC values and indicating the final model
(only returned if argument crit is "BIC"
and argument s indicates more than one step along
the sequence).model is TRUE).model is TRUE).coef,
fitted,
plot,
predict,
residuals,
lmrobdata("TopGear")
# keep complete observations
keep <- complete.cases(TopGear)
TopGear <- TopGear[keep, ]
# remove information on car model
info <- TopGear[, 1:3]
TopGear <- TopGear[, -(1:3)]
# log-transform price
TopGear$Price <- log(TopGear$Price)
# robust groupwise LARS
rgrplars(MPG ~ ., data = TopGear, sMax = 15)Run the code above in your browser using DataLab