| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/boot.R |
| 3 |
\name{tidy.boot} |
| 4 |
\alias{tidy.boot} |
| 5 |
\alias{boot_tidiers} |
| 6 |
\title{Tidy a(n) boot object} |
| 7 |
\usage{ |
| 8 |
\method{tidy}{boot}( |
| 9 |
x, |
| 10 |
conf.int = FALSE, |
| 11 |
conf.level = 0.95, |
| 12 |
conf.method = c("perc", "bca", "basic", "norm"), |
| 13 |
exponentiate = FALSE, |
| 14 |
... |
| 15 |
) |
| 16 |
} |
| 17 |
\arguments{ |
| 18 |
\item{x}{A \code{\link[boot:boot]{boot::boot()}} object.} |
| 19 |
|
| 20 |
\item{conf.int}{Logical indicating whether or not to include a confidence |
| 21 |
interval in the tidied output. Defaults to \code{FALSE}.} |
| 22 |
|
| 23 |
\item{conf.level}{The confidence level to use for the confidence interval |
| 24 |
if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1. |
| 25 |
Defaults to 0.95, which corresponds to a 95 percent confidence interval.} |
| 26 |
|
| 27 |
\item{conf.method}{Passed to the \code{type} argument of \code{\link[boot:boot.ci]{boot::boot.ci()}}. |
| 28 |
Defaults to \code{"perc"}. The allowed types are \code{"perc"}, \code{"basic"}, |
| 29 |
\code{"bca"}, and \code{"norm"}. Does not support \code{"stud"} or \code{"all"}.} |
| 30 |
|
| 31 |
\item{exponentiate}{Logical indicating whether or not to exponentiate the |
| 32 |
the coefficient estimates. This is typical for logistic and multinomial |
| 33 |
regressions, but a bad idea if there is no log or logit link. Defaults |
| 34 |
to \code{FALSE}.} |
| 35 |
|
| 36 |
\item{...}{Additional arguments. Not used. Needed to match generic |
| 37 |
signature only. \strong{Cautionary note:} Misspelled arguments will be |
| 38 |
absorbed in \code{...}, where they will be ignored. If the misspelled |
| 39 |
argument has a default value, the default value will be used. |
| 40 |
For example, if you pass \code{conf.lvel = 0.9}, all computation will |
| 41 |
proceed using \code{conf.level = 0.95}. Two exceptions here are: |
| 42 |
\itemize{ |
| 43 |
\item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if |
| 44 |
it will be ignored. |
| 45 |
\item \code{augment()} methods will warn when supplied a \code{newdata} argument if it |
| 46 |
will be ignored. |
| 47 |
}} |
| 48 |
} |
| 49 |
\description{ |
| 50 |
Tidy summarizes information about the components of a model. |
| 51 |
A model component might be a single term in a regression, a single |
| 52 |
hypothesis, a cluster, or a class. Exactly what tidy considers to be a |
| 53 |
model component varies across models but is usually self-evident. |
| 54 |
If a model has several distinct types of components, you will need to |
| 55 |
specify which components to return. |
| 56 |
} |
| 57 |
\details{ |
| 58 |
If weights were provided to the \code{boot} function, an \code{estimate} |
| 59 |
column is included showing the weighted bootstrap estimate, and the |
| 60 |
standard error is of that estimate. |
| 61 |
|
| 62 |
If there are no original statistics in the "boot" object, such as with a |
| 63 |
call to \code{tsboot} with \code{orig.t = FALSE}, the \code{original} |
| 64 |
and \code{statistic} columns are omitted, and only \code{estimate} and |
| 65 |
\code{std.error} columns shown. |
| 66 |
} |
| 67 |
\examples{ |
| 68 |
\dontshow{if (rlang::is_installed("boot")) withAutoprint(\{ # examplesIf} |
| 69 |
|
| 70 |
# load modeling library |
| 71 |
library(boot) |
| 72 |
|
| 73 |
clotting <- data.frame( |
| 74 |
u = c(5, 10, 15, 20, 30, 40, 60, 80, 100), |
| 75 |
lot1 = c(118, 58, 42, 35, 27, 25, 21, 19, 18), |
| 76 |
lot2 = c(69, 35, 26, 21, 18, 16, 13, 12, 12) |
| 77 |
) |
| 78 |
|
| 79 |
# fit models |
| 80 |
g1 <- glm(lot2 ~ log(u), data = clotting, family = Gamma) |
| 81 |
|
| 82 |
bootfun <- function(d, i) { |
| 83 |
coef(update(g1, data = d[i, ])) |
| 84 |
} |
| 85 |
|
| 86 |
bootres <- boot(clotting, bootfun, R = 999) |
| 87 |
|
| 88 |
# summarize model fits with tidiers |
| 89 |
tidy(g1, conf.int = TRUE) |
| 90 |
tidy(bootres, conf.int = TRUE) |
| 91 |
\dontshow{\}) # examplesIf} |
| 92 |
} |
| 93 |
\seealso{ |
| 94 |
\code{\link[=tidy]{tidy()}}, \code{\link[boot:boot]{boot::boot()}}, \code{\link[boot:tsboot]{boot::tsboot()}}, \code{\link[boot:boot.ci]{boot::boot.ci()}}, |
| 95 |
\code{\link[rsample:bootstraps]{rsample::bootstraps()}} |
| 96 |
} |
| 97 |
\value{ |
| 98 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with columns: |
| 99 |
\item{bias}{Bias of the statistic.} |
| 100 |
\item{std.error}{The standard error of the regression term.} |
| 101 |
\item{term}{The name of the regression term.} |
| 102 |
\item{statistic}{Original value of the statistic.} |
| 103 |
|
| 104 |
} |