Skip to contents

Unnest the data output from tidy_bootstrap().

Usage

bootstrap_unnest_tbl(.data)

Arguments

.data

The data that is passed from the tidy_bootstrap() function.

Value

A tibble

Details

This function takes as input the output of the tidy_bootstrap() function and returns a two column tibble. The columns are sim_number and y

It looks for an attribute that comes from using tidy_bootstrap() so it will not work unless the data comes from that function.

Author

Steven P. Sanderson II, MPH

Examples

tb <- tidy_bootstrap(.x = mtcars$mpg)
bootstrap_unnest_tbl(tb)
#> # A tibble: 50,000 × 2
#>    sim_number     y
#>    <fct>      <dbl>
#>  1 1           18.1
#>  2 1           21.5
#>  3 1           22.8
#>  4 1           15.5
#>  5 1           14.7
#>  6 1           15.5
#>  7 1           14.7
#>  8 1           18.7
#>  9 1           13.3
#> 10 1           15.5
#> # … with 49,990 more rows

bootstrap_unnest_tbl(tb) %>%
  tidy_distribution_summary_tbl(sim_number)
#> # A tibble: 2,000 × 13
#>    sim_num…¹ mean_…² media…³ std_val min_val max_val skewn…⁴ kurto…⁵ range   iqr
#>    <fct>       <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl> <dbl> <dbl>
#>  1 1            19.6    18.7    4.91    10.4    30.4   0.329    2.51  20    7.3 
#>  2 2            20.0    21      5.33    10.4    33.9   0.291    4.10  23.5  3.30
#>  3 3            21.3    21      6.10    10.4    33.9   0.597    2.84  23.5  5   
#>  4 4            18.8    19.2    5.43    10.4    32.4   0.607    3.51  22    5.6 
#>  5 5            20.8    21      6.15    10.4    32.4   0.155    2.11  22    8.6 
#>  6 6            18.5    17.3    5.91    10.4    30.4   0.714    2.79  20    6.2 
#>  7 7            21.1    18.7    6.72    10.4    33.9   0.618    2.33  23.5  8.9 
#>  8 8            20.8    19.7    6.51    13.3    33.9   0.888    2.74  20.6  7.3 
#>  9 9            21.2    19.7    5.90    14.3    32.4   0.592    2.13  18.1  8.9 
#> 10 10           18.9    18.1    4.62    10.4    32.4   0.644    4.52  22    5.6 
#> # … with 1,990 more rows, 3 more variables: variance <dbl>, ci_low <dbl>,
#> #   ci_high <dbl>, and abbreviated variable names ¹​sim_number, ²​mean_val,
#> #   ³​median_val, ⁴​skewness, ⁵​kurtosis