add_one_categorical {SimTimeVar}R Documentation

Generate linear predictor from logistic model

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

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

# 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)

[Package SimTimeVar version 1.0.0 Index]