Skip to contents

Resamples the unit's items with replacement, keeping each item's location and modal aligned level, and re-estimates the cut scores in every sample.

Usage

bootstrapping(x, ...)

# S3 method for class 'ESS'
bootstrapping(
  x,
  unit,
  n = 100,
  seed = NULL,
  grid = c("items", "jittered"),
  ...
)

Arguments

x

An object of class `"ESS"`.

...

Former argument names, still accepted with a warning: `gca_name` (now `unit`) and `boot_num` (now `n`).

unit

The unit to bootstrap, as named in `extract(x, "cutscore")`.

n

Number of bootstrap samples. Default `100`.

seed

Optional random seed, for reproducible draws.

grid

Candidate cuts in each sample: * `"items"` (default): the sampled items' locations, with the exact ESS minimum, the same estimator as [emstans()] (with `smooth = TRUE` in the original fit, the GAM-smoothed minimum). * `"jittered"`: an evenly spaced grid over the location range (step 0.1 when the range is under 10, else 1), each point randomly moved by up to one step, shared by all cut levels; the cut is the minimum of a GAM-smoothed inconsistency curve over that grid. This is the bootstrap used by EmStanS before the 0.1.0 rewrite.

Value

An object of class `"bootESS"`: use `print()`, `summary()`, `extract()`, `report()`.

Examples

set.seed(1)
sim <- generateMockDataSet(ngca = 2, ntable = 2, npanelist = 3,
                           cor_val = 0.7, nlevel = 3, sdinp = 1, ecinp = 0,
                           n = 30, 300, 500)
res <- emstans(data = sim, location = "Loc_RP50")
boot <- bootstrapping(res, unit = "M1-All", n = 50, seed = 1)
boot
#> Bootstrap of modal cut scores for M1-All (50 samples, item locations, exact minimum)
#>  cut_level  n  mean     sd median   min   max  q2.5 q97.5 estimate
#>     Level1 50 337.8  8.228  341.2 302.7 342.4 312.4 342.4    341.2
#>     Level2 50 426.8 16.131  430.3 376.8 454.0 399.5 443.5    430.3
head(extract(boot, "draws"))
#>   rep cut_level cut_score inconsistency
#> 1   1    Level1     340.3           9.2
#> 2   1    Level2     437.4           6.1
#> 3   2    Level1     342.4           0.0
#> 4   2    Level2     432.2          23.3
#> 5   3    Level1     342.4           7.1
#> 6   3    Level2     443.5          84.9
extract(boot, "plot")

if (interactive()) report(boot)

# The jittered-grid bootstrap
bootstrapping(res, unit = "M1-All", n = 10, seed = 1, grid = "jittered")
#> Bootstrap of modal cut scores for M1-All (10 samples, jittered grid, smoothed minimum)
#>  cut_level  n  mean    sd median   min   max  q2.5 q97.5 estimate
#>     Level1 10 338.0 8.694  339.7 321.9 349.7 322.9 348.6    341.2
#>     Level2 10 428.4 9.294  430.9 411.7 437.2 411.7 437.2    430.3