Skip to content
Prev 374715 / 398506 Next

Bootstrap and average median squared error

Hello,

Right!
I copied from the OP's question without thinking about it.
Corrected would be


bootMedianSE <- function(data, indices){
     d <- data[indices, ]
     fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d)
     ypred <- predict(fit)
     y <- d$crp
     median((y - ypred)^2)
}

Sorry,

rui Barradas
On 5/22/2018 11:32 AM, Daniel Nordlund wrote: