Creates a list of vectors, each containing the randomly generated cumulative proportions of a discrete variable.
Details
cat_options and n_cat_options must be the same length.
cat_options = 1 is a continuous variable.
The result from proportion_gen can be used directly with the
cat_prop argument of questionnaire_gen.
Examples
proportion_gen(cat_options = c(1, 2, 3), n_cat_options = c(2, 2, 2))
#> [[1]]
#> [1] 1
#>
#> [[2]]
#> [1] 1
#>
#> [[3]]
#> [1] 0.35 1.00
#>
#> [[4]]
#> [1] 0.38 1.00
#>
#> [[5]]
#> [1] 0.25 0.52 1.00
#>
#> [[6]]
#> [1] 0.30 0.58 1.00
#>
proportion_gen(cat_options = c(1, 3), n_cat_options = c(4, 5))
#> [[1]]
#> [1] 1
#>
#> [[2]]
#> [1] 1
#>
#> [[3]]
#> [1] 1
#>
#> [[4]]
#> [1] 1
#>
#> [[5]]
#> [1] 0.18 0.55 1.00
#>
#> [[6]]
#> [1] 0.32 0.39 1.00
#>
#> [[7]]
#> [1] 0.40 0.91 1.00
#>
#> [[8]]
#> [1] 0.06 0.49 1.00
#>
#> [[9]]
#> [1] 0.31 0.33 1.00
#>