Generate an informative (weighted) data sample according to model_no
Source: R/32-data_gen_weighted.R
gen_data_bin_wt.Rd
Generate an informative (weighted) data sample according to model_no
Usage
gen_data_bin_wt(
model_no = 1,
seed = NULL,
H1 = FALSE,
return_all = FALSE,
n = 1000,
popfac = 10
)
Arguments
- model_no
(integer) Choose from 1–5. See pkgdown articles for details.
- 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?
- n
(numeric > 0) Sample size.
- popfac
The multiplier for the population size. That is, the population size will be set to
popfac * n
.
Examples
gen_data_bin_wt(1)
#> # A tibble: 1,000 × 6
#> wt y1 y2 y3 y4 y5
#> <dbl> <ord> <ord> <ord> <ord> <ord>
#> 1 1.17 1 1 1 1 1
#> 2 0.777 1 1 1 1 1
#> 3 1.16 1 1 1 1 0
#> 4 1.55 1 1 1 1 1
#> 5 0.573 0 0 0 1 1
#> 6 0.682 1 1 0 0 1
#> 7 0.635 1 1 0 1 1
#> 8 0.605 0 0 0 0 0
#> 9 1.20 1 1 1 1 1
#> 10 0.585 0 1 0 1 1
#> # ℹ 990 more rows