x <- c(1:7, 1000)
sd(x) # non-robust std.deviation
scaleTau2(x)
scaleTau2(x, mu.too = TRUE)
if(doExtras <- robustbase:::doExtras()) {
set.seed(11)
## show how much faster this is, compared to Qn
x <- sample(c(rnorm(1e6), rt(5e5, df=3)))
(system.time(Qx <- Qn(x)))
(system.time(S2x <- scaleTau2(x)))
cbind(Qn = Qx, sTau2 = S2x)
}
Run the code above in your browser using DataLab