Skip to contents

summary() creates a regression summary-like table that displays the bootstrap estimates, their empirical standard errors, and their confidence intervals. confint() produces just the confidence intervals, which are computed using fwb.ci(), and is called internally by summary().

Usage

# S3 method for class 'fwb'
summary(
  object,
  conf = 0.95,
  ci.type = "bc",
  p.value = FALSE,
  index = 1L:ncol(object$t),
  ...
)

# S3 method for class 'fwb'
confint(object, parm, level = 0.95, ci.type = "bc", ...)

Arguments

object

an fwb object; the output of a call to fwb().

conf, level

the desired confidence level. Default is .95 for 95% confidence intervals.

ci.type

the type of confidence interval desired. Allowable options include "norm" (normal approximation), "basic" (basic interval), "perc" (percentile interval), "bc" (bias-correct percentile interval), and "bca" (bias-corrected and accelerated [BCa] interval). Only one is allowed. BCa intervals require that the number of bootstrap replications is larger than the sample size. See fwb.ci() for details. The default is "bc".

p.value

logical; whether to display p-values for the test that each parameter is equal to 0. The p-value is computed using a Z-test with the test statistic computed as the ratio of the estimate to its bootstrap standard error. This test is only valid when the bootstrap distribution is normally distributed around 0 and is not guaranteed to agree with any of the confidence intervals. Default is FALSE.

index, parm

the index or indices of the position of the quantity of interest in x$t0 if more than one was specified in fwb(). Default is to display all quantities.

...

ignored.

Value

For summary(), a summary.fwb object, which is a matrix with the following columns:

  • Estimate: the statistic estimated in the original sample

  • Std. Error: the standard deviation of the bootstrap estimates

  • CI {L}% and CI {U}%, the upper and lower confidence interval bounds computed using the argument to ci.type.

When p.value = TRUE, two additional columns, z value and Pr(>|z|), are included containing the z-statistic and p-value for each computed statistic, respectively.

For confint(), a matrix with a row for each statistic and a column for the upper and lower confidence interval limits.

See also

fwb() for performing the fractional weighted bootstrap; fwb.ci() for computing multiple confidence intervals for a single bootstrapped quantity

Examples

set.seed(123, "L'Ecuyer-CMRG")
data("infert")

fit_fun <- function(data, w) {
  fit <- glm(case ~ spontaneous + induced, data = data,
             family = "quasibinomial", weights = w)
  coef(fit)
}

fwb_out <- fwb(infert, fit_fun, R = 199,
               verbose = FALSE)

# Basic confidence interval for both estimates
summary(fwb_out, ci.type = "basic")
#>             Estimate Std. Error CI 2.5 % CI 97.5 %
#> (Intercept)  -1.7079     0.2647  -2.2118   -1.2074
#> spontaneous   1.1972     0.2185   0.7532    1.6483
#> induced       0.4181     0.1975   0.0331    0.8116

# Just for "induced" coefficient; p-values requested
summary(fwb_out, index = "induced", p.value = TRUE)
#>         Estimate Std. Error CI 2.5 % CI 97.5 % z value Pr(>|z|)  
#> induced   0.4181     0.1975   0.0178    0.7980    2.12    0.034 *
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1