add_one_categorical {SimTimeVar} | R Documentation |
An internal function not intended for the user. Given a dataset and multinomial regression parameters, generates a categorical variable and adds it to the dataset.
add_one_categorical(.d, n, obs, cat.parameters)
.d |
The dataset to which to add the categorical variable. |
n |
The number of clusters. |
obs |
The number of observations per cluster. |
cat.parameters |
A dataframe of parameters for generating the categorical variable. See Details. |
# mini dataset with 3 observations per person
data = data.frame( male = rep( rbinom(n=10, size=1, prob=0.5), each=3 ) )
add_one_categorical( data, 10, 3, cat.params)