Skip to contents

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.

Value

A tibble() containing ordinal binary values (0/1) for the items.

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.18  1     1     1     1     1    
#>  2 0.550 0     1     1     0     1    
#>  3 0.762 1     1     1     1     1    
#>  4 0.631 1     0     0     0     1    
#>  5 1.97  1     1     1     1     1    
#>  6 2.00  1     1     1     1     1    
#>  7 0.739 1     0     1     1     1    
#>  8 0.695 1     1     1     0     0    
#>  9 0.878 1     1     1     1     1    
#> 10 0.817 1     1     0     1     1    
#> # ℹ 990 more rows