These functions are used by the Robust Regression dialog.
menuLtsreg
calls
tabSummary.lts and
tabPlot.lts
if summary and plotting results are requested.
a formula object, with the response on the left of a `~' operator,
and the terms, separated by
+ operators, on the right.
ltsobj
n object that inherits from class
lts.
OPTIONAL ARGUMENTS:
data
a
data.frame in which to interpret the variables named in the
formula, or in the
subset and the
weights argument.
If this is missing, then the variables in the formula should be on the
search list.
weights
vector of observation weights; if supplied,
the algorithm fits to minimize the sum
of the weights multiplied into the squared residuals.
The length of
weights must be the same as the number of observations.
The weights must be nonnegative and it is strongly recommended that they
be strictly positive, since zero weights are ambiguous, compared to use
of the
subset argument.
subset
expression saying which subset of the rows of the data
should be used in the fit.
This can be a logical vector (which is replicated to have length equal
to the number of observations), or a numeric vector indicating which
observation numbers are to be included, or a character vector of the
row names to be included.
All observations are included by default.
na.omit.p
if
TRUE, then any observation with missing values are removed
from the analysis.
If
FALSE and there are missing values then the function will exit
with a message that missing values are not allowed.
If
na.omit.p is
TRUE then
na.action is set to
na.omit in the
call to
ltsreg.
If
na.omit.p is
FALSE then
na.action is set to
na.fail in the
call to
ltsreg.
quan
the number of squared residuals whose sum will be minimized.
This defaults to
floor((n+p+1)/2)
where
n is the number of observations
and
p s the number of predictors in the model.
print.short.p
if
TRUE, a short summary of the linear regression is printed.
This output is from the function
print.lts.
print.long.p
if
TRUE, a long summary of the linear regression is printed.
This output is from the function
summary.lts.
save.name
a character string for the name of the data frame to save the
fit and residuals in.
If data frame with this name already exists in database 1 and it has the
appropriate number of rows then the saved values will be appended
to the data frame.
If the object already exist in database 1 and it is not a data frame
or it does not have the appropriate number of rows then a new name
is created by appending a number to
save.name and the results are
saved in the data frame with the new name.
save.fit.p
if
TRUE, the fitted values from the regression are saved in the
data frame
save.name.
save.resid.p
if
TRUE, the residuals from the regression are saved in the
data frame
save.name.
save.weights.p
if
TRUE, weights with a value of 1 for observations with reasonably small
residuals and a value of 0 for observations with large residuals are saved.
These weights can latter be used in an ordinary least squares regression.
plotResidVsFit.p
f
TRUE, a plot of the standardized residuals versus the fitted values
is created.
plotResidVsIndex.p
if
TRUE, a plot of the standardized residuals versus the
index of the observations is created.
plotQQ.p
if
TRUE, a Normal quantile-quantile plot of the LTS residuals is drawn.
plotResidVsDist.p
if
TRUE, a plot of the LTS residuals vs Robust Distances of
x-rows
is created.
id.n
he number of extreme points that will be identified on the plots.
The row names from the model's data frame will be used to identify the points.
VALUE:
invisibly returns an object of class
lts.
See the
lts.object help file for details.
SIDE EFFECTS:
Printed output will be displayed if requested.
Plots will be drawn if requested.
The objects
save.name and
predobj.name will be created or appended
to if fitted values, residuals or predictions are saved