boot.se | R Documentation |
Compute bootstrap standard errors (SE) for a given (generalized) linear model.
boot.se(fit, boot, probs = c(0.025, 0.975), z0 = 1.96, b0 = 0, ...)
fit |
An object of class |
boot |
A bootstrapped model object (see the examples section). |
probs |
Bootstrap intervals (default = c(0.025, 0.975)). |
z0 |
z-score under null hypothesis (default = 1.96). |
b0 |
Effect size under null hypothesis (default = 0). |
... |
Currently ignored. |
A data.frame of 9 columns:
"Variable", variable name;
"Estimate", parameter (effect size) estimate;
"se.boot", bootstrap standard error;
"lower", confidence interval lower bound;
"upper", confidence interval upper bound;
"conf.level", confidence level;
"method", estimation method;
"z", z-score = (estimate - b0)/SE;
"P", 2-sided p-value; i.e., 2*pnorm(-abs(z)).
Fernando Palluzzi fernando.palluzzi@gmail.com
Pruim R, Kaplan DT, Horton NJ (2017). The mosaic Package: Helping Students to 'Think with Data' Using R. The R Journal, 9(1), 77–102. <https://journal.r-project.org/archive/2017/RJ-2017-024/index.html>
See p.boot
for performance indices
bootstrap confidence intervals.
See also do
for resampling.
# Dichotomized dataset creation x <- dichotomize(mpm.us, asFactor = TRUE) # Model specification model <- formula(paste0(c("y ~ shortAxis + cortical + hilum + ", "inflammatoryStroma + extracapsularSpread + ", "ecostructure + FID + VFL + corticalThickening + ", "vascularPattern + CMID + shape + grouping + ", "colorScore"), collapse = "")) # Binomial model fitting (MLE) fit <- glm(model, data = x, family = "binomial") # Binomial model fitting n.reps <- 100 boot <- mosaic::do(n.reps) * coef(glm(model, data = mosaic::resample(x), family = "binomial")) # Bootstrap SE calculation SE <- boot.se(fit, boot) print(SE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.