Skip to contents

Resamples items, or whole clusters of items when a cluster column is present, and recomputes a user-supplied statistic on each replicate. Use this when the quantity of interest is not a mean and the analytic standard errors elsewhere in the package do not apply: medians, quantiles, pass rates above a threshold, or any custom score aggregation.

Usage

ev_bootstrap(
  data,
  model = NULL,
  statistic = mean,
  R = 2000,
  level = 0.95,
  type = c("percentile", "basic"),
  seed = NULL,
  ...
)

Arguments

data

An evaluatellm_eval object from as_eval(), a data frame, or a bare numeric or logical vector of scores.

model

Which model to score. Optional when the data holds only one.

statistic

A function taking a numeric vector of item scores and returning a single number. Default mean().

R

Number of bootstrap replicates. Default 2000.

level

Confidence level. Default 0.95.

type

Interval type, "percentile" (default) or "basic".

seed

Optional integer seed for reproducibility.

...

Passed to as_eval() when data is a plain data frame.

Value

An evaluatellm_bootstrap object with elements estimate, se, conf_low, conf_high, replicates, R, type, and level.

Details

Resampling clusters rather than items preserves the dependence structure, so the resulting interval carries the same protection as ev_cluster().

See also

Examples

set.seed(5)
e <- as_eval(rbeta(300, 6, 3))
ev_bootstrap(e, statistic = median, R = 500, seed = 1)
#> 
#> Cluster bootstrap: model
#> 
#>   Estimate   0.6872
#>   Boot SE    0.0092
#>   95% CI     [0.6706, 0.7037] (percentile)
#> 
#>   Replicates 500
#>   Resampled  300 items
#>