I'm new in statistics. Hope you can help me on the following:
I want to use least trimmed squared (LTS) for regression. Below is the coding in R:
lts2_M1 <- function(failure)
{
library(MASS)
y_log <- failure[, 1]
x11 <- failure[, 4]
x2 <- failure[, 3]
fit0 <- lqs(y_log ~ x11+x2, method = "lts", nsamp = "exact")
list(fit0)
}
the result is:
lqs.formula(formula = y_log ~ x11 + x2, nsamp = "exact",
method = "lts")
Coefficients:
(Intercept) x11 x2
-5.234269 -0.002685 0.110067
Scale estimates 0.2065 0.2301
Question:
- Is that the correct way to perform LTS for regression?
- In some of R example, i saw that they are using 'ltsReg'. what is the difference with the above method then?
- From the result, residual standard error=0.2065. what is the formula used to calculate that?