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.730 1     1     0     1     1    
#>  2 1.07  1     0     0     0     1    
#>  3 0.695 1     1     1     1     1    
#>  4 0.968 1     0     1     0     1    
#>  5 0.810 1     1     0     1     0    
#>  6 0.758 1     0     1     1     1    
#>  7 1.27  1     1     1     1     1    
#>  8 0.579 0     1     0     1     1    
#>  9 0.646 1     0     0     1     1    
#> 10 0.889 1     1     1     1     1    
#> # ℹ 990 more rows