Skip to contents

For a given index function, simulates how the index behaves across a range of sample sizes when applied to pairs of standard normal noise.

Usage

ppi_samplesize_effect(index_fun, n_sim = 100)

Arguments

index_fun

A function taking two numeric vectors (x, y) and returning a scalar index.

n_sim

Integer. Number of simulations per sample size. Default is 100.

Value

A tibble with:

  • sample_size: sample size used for each simulation block

  • percentile95: 95th percentile of the index values over simulations

Examples

ppi_samplesize_effect(scag_index("stringy"), n_sim = 10)
#> # A tibble: 125 × 2
#>    sample_size percentile95
#>          <dbl>        <dbl>
#>  1          30        0.773
#>  2          35        0.815
#>  3          40        0.871
#>  4          45        0.794
#>  5          50        0.795
#>  6          55        0.788
#>  7          60        0.770
#>  8          65        0.793
#>  9          70        0.763
#> 10          75        0.770
#> # ℹ 115 more rows