
Last chance! 50% off unlimited learning
Sale ends in
Creates a list of vectors, each containing the randomly generated cumulative proportions of a discrete variable.
proportion_gen(cat_options, n_cat_options)
vector of response types.
vector of number of items of the corresponding response type.
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
.
proportion_gen(cat_options = c(1, 2, 3), n_cat_options = c(2, 2, 2))
proportion_gen(cat_options = c(1, 3), n_cat_options = c(4, 5))
Run the code above in your browser using DataLab