The function checks that the data is supplied as a data.frame or tibble and that it contains an equal number of choice observations per individual.

prepare_data(db, str_id, str_ct, n_id, n_ct, cores, check_data)

Arguments

db

A data.frame() or tibble() containing the data

str_id

A character string giving the name of the id variable

str_ct

A character string giving the name of the ct variable

n_id

An integer giving the nubmer of respondents

n_ct

An integer giving the number of choice situations

cores

An integer indicating the number of cores to use in estimation

check_data

A boolean eqaul to TRUE if the code should skip the data checks on number of choice tasks per individual.

Value

A data.frame padded with NA

Details

NOTE: While padding allows the use of fast matrix operations, it may come at the cost of disproportionate memory use for large datasets with many observations and variables.