summary()
creates a regression summary-like table that displays the bootstrap estimates, their empirical standard errors, and their confidence intervals, which are computed using fwb.ci()
.
Arguments
- object
an
fwb
object; the output of a call tofwb()
.- conf
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. Seefwb.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 isFALSE
.- index
the index or indices of the position of the quantity of interest in
x$t0
if more than one was specified infwb()
. Default is to display all quantities.- ...
ignored.
Value
A summary.fwb
object, which is a matrix with the following columns:
Estimate
: the statistic estimated in the original sampleStd. Error
: the standard deviation of the bootstrap estimatesCI {L}%
andCI {U}%
, the upper and lower confidence interval bounds computed using the argument toci.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.
Examples
set.seed(123)
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.2566 -2.1334 -1.1875
#> spontaneous 1.1972 0.2036 0.7023 1.5613
#> induced 0.4181 0.1823 0.0471 0.7979
# 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.1823 0.0539 0.8536 2.29 0.022 *
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1