| .hurdle_prepare_data | R Documentation |
Internal function to prepare data structures for TMB hurdle model fitting. Converts subject IDs to 0-indexed integers and creates derived variables.
.hurdle_prepare_data(data, y_var, x_var, id_var)
data |
A validated data frame. |
y_var |
Character string, name of consumption variable. |
x_var |
Character string, name of price variable. |
id_var |
Character string, name of subject ID variable. |
A list containing:
Numeric vector of prices
Numeric vector of consumption values
Integer vector (1 if consumption == 0, else 0)
Log consumption (0 for zeros)
0-indexed subject IDs for C++
Unique subject IDs (original)
Number of unique subjects
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.