add_one_categorical: Generate linear predictor from logistic model

Description Usage Arguments Examples

Description

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.

Usage

1
add_one_categorical(.d, n, obs, cat.parameters)

Arguments

.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.

Examples

1
2
3
# 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)

SimTimeVar documentation built on May 2, 2019, 8:31 a.m.