Internal helper function to validate required columns in demand data and ensure that specified factor columns are correctly formatted and have unused levels dropped.
validate_demand_data(data, y_var, x_var, id_var, factors = NULL)The validated and prepared data frame.
A data frame.
Character string, the name of the dependent variable column.
Character string, the name of the independent variable column.
Character string, the name of the subject/group identifier column.
Character vector of factor names (can be NULL).