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 0.647 1     1     0     1     1    
#>  2 1.07  1     1     1     0     1    
#>  3 1.12  1     1     1     1     1    
#>  4 0.651 1     1     0     1     1    
#>  5 0.813 1     1     0     1     0    
#>  6 0.832 1     1     0     0     1    
#>  7 1.97  1     1     1     0     1    
#>  8 0.846 1     1     1     1     1    
#>  9 0.798 1     1     0     1     1    
#> 10 0.855 1     1     1     1     1    
#> # ℹ 990 more rows