data(schooldata)
school.x <- data.matrix(schooldata[,1:5])
school.y <- data.matrix(schooldata[,6:8])
## compute 25% breakdown S-estimates
Sres <- Sest_multireg(school.x,school.y, bdp=0.25)
# \donttest{
## or using the formula interface
Sres <- Sest_multireg(cbind(reading,mathematics,selfesteem)~., data=schooldata, bdp=0.25)
## the regression coefficients:
Sres$coefficients
## or alternatively
coef(Sres)
n <- nrow(schooldata)
oldpar <- par(mfrow=c(2,1))
## the estimates can be considered as weighted least squares estimates with the
## following implicit weights
plot(1:n, Sres$weights)
## Sres$outFlag tells which points are outliers based on whether or not their
## robust distance exceeds the .975 chi-square cut-off:
plot(1:n, Sres$outFlag)
## (see also the diagnostic plot in plotDiag())
par(oldpar)
# }
Run the code above in your browser using DataLab