Generate independent data samples according to model_no
Usage
gen_data_bin(
model_no = 1,
n = 1000,
seed = NULL,
H1 = FALSE,
return_all = FALSE
)
Arguments
- model_no
(integer) Choose from 1–5. See pkgdown articles for details.
- n
(numeric > 0) Sample size.
- seed
(numeric) The random seed.
- H1
(logical) Are we generating a data to misspecify the true model?
For power simulations.
- return_all
(logical) Return the underlying latent variable \(y^*\) as
well?
Value
A tibble()
containing ordinal binary values (0/1) for the items.
Examples
gen_data_bin(1)
#> # A tibble: 1,000 × 5
#> y1 y2 y3 y4 y5
#> <ord> <ord> <ord> <ord> <ord>
#> 1 1 1 1 1 1
#> 2 1 0 1 0 0
#> 3 1 1 0 1 1
#> 4 1 0 0 1 0
#> 5 1 1 0 0 1
#> 6 1 0 1 0 1
#> 7 1 1 0 1 1
#> 8 1 0 1 1 1
#> 9 1 0 0 0 0
#> 10 1 0 0 1 1
#> # ℹ 990 more rows