Bootstrap CI
boot_ci.Rd
Mean and bootstrap confidence interval.
Arguments
- stat
Vector of observations for some statistic.
- ci
Confidence interval in percentile units.
- R
Number of bootstrap iterations to use when calculating statistics.
Value
Results with mean
, lower
, and upper
columns indicating the mean
statistic and the lower and upper bounds of the CI based on a bootstrap
procedure.
Examples
# Calculate analysis results
raw <- sample_data("Morton2013")
data <- merge_free_recall(raw)
results <- spc(data)
# Calculate statistics grouped by input (serial) position
library(magrittr)
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
results %>%
group_by(input) %>%
summarise(boot_ci(recall))
#> # A tibble: 24 × 4
#> input mean lower upper
#> <dbl> <dbl> <dbl> <dbl>
#> 1 1 0.565 0.519 0.611
#> 2 2 0.505 0.457 0.554
#> 3 3 0.479 0.438 0.522
#> 4 4 0.443 0.408 0.480
#> 5 5 0.458 0.420 0.499
#> 6 6 0.449 0.416 0.483
#> 7 7 0.432 0.401 0.464
#> 8 8 0.421 0.384 0.454
#> 9 9 0.444 0.408 0.480
#> 10 10 0.436 0.397 0.477
#> # ℹ 14 more rows