if (require(mosaicData)) {
bootstrap <- do(500) * diffmean( age ~ sex, data = resample(HELPrct) )
confint(bootstrap)
confint(bootstrap, method = "percentile")
confint(bootstrap, method = "boot")
confint(bootstrap, method = "se", df = nrow(HELPrct) - 1)
confint(bootstrap, margin.of.error = FALSE)
confint(bootstrap, margin.of.error = TRUE, level = 0.99,
method = c("se", "perc") )
# bootstrap t method requires both mean and sd
bootstrap2 <- do(500) * favstats(resample(1:10))
confint(bootstrap2, method = "boot")
}
lm(width ~ length * sex, data = KidsFeet) |>
summary() |>
confint()
Run the code above in your browser using DataLab