Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


lsasim (version 2.1.6)

proportion_gen: Generation of random cumulative proportions

Description

Creates a list of vectors, each containing the randomly generated cumulative proportions of a discrete variable.

Usage

proportion_gen(cat_options, n_cat_options)

Arguments

cat_options

vector of response types.

n_cat_options

vector of number of items of the corresponding response type.

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

Run this code
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