View source: R/make_likert_thresholds.R
| make_likert_thresholds | R Documentation |
Convenience helper to build per-item thresholds for the latent normal scale
used by sample_size_EGA_montecarlo() when data_type =
"ordinal". Useful for simulating realistic Likert scenarios with floor or
ceiling effects rather than the unrealistic equiprobable default.
Patterns are parameterized via a Beta distribution over the latent
cumulative scale: shape1 = shape2 = 1 gives equiprobable categories,
shape1 < shape2 concentrates mass on lower categories (floor),
shape1 > shape2 concentrates mass on upper categories (ceiling).
make_likert_thresholds(
n_items,
categories,
pattern = c("equiprobable", "floor", "ceiling", "mixed", "custom"),
shape1 = NULL,
shape2 = NULL,
seed = NULL
)
n_items |
Integer number of items. |
categories |
Integer number of ordinal response categories (>= 2). |
pattern |
One of |
shape1 |
First Beta shape parameter, used when |
shape2 |
Second Beta shape parameter, used when |
seed |
Optional integer seed for the shuffling step in
|
A list of length n_items, each element a numeric vector of
categories - 1 thresholds on the standard normal scale.
# 18 items, 5 categories, all with floor effect
tau_floor <- make_likert_thresholds(18, 5, "floor")
tau_floor[[1]]
# Half floor, half ceiling, randomly interleaved
tau_mixed <- make_likert_thresholds(18, 5, "mixed", seed = 1)
# Custom skew via Beta(1.5, 4)
tau_custom <- make_likert_thresholds(18, 5, "custom",
shape1 = 1.5, shape2 = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.