Prints tables comparing the shares predicted by the model with the shares observed in the data.
apollo_sharesTest(
model,
apollo_probabilities,
apollo_inputs,
sharesTest_settings
)
Model object. Estimated model object as returned by function apollo_estimate.
Function. Returns probabilities of the model to be estimated. Must receive three arguments:
apollo_beta
: Named numeric vector. Names and values of model parameters.
apollo_inputs
: List containing options of the model. See apollo_validateInputs.
functionality
: Character. Can be either "estimate" (default), "prediction", "validate", "conditionals", "zero_LL", or "raw".
List grouping most common inputs. Created by function apollo_validateInputs.
List of arguments. It must include the following.
alternatives
: Named numeric vector. Names of alternatives and their corresponding value in choiceVar
.
choiceVar
: Numeric vector. Contains choices for all observations. It will usually be a column from the database. Values are defined in alternatives
.
subsamples
: Named list of boolean vectors. Each element of the list defines whether a given observation belongs to a given subsample (e.g. by sociodemographics).
modelComponent
: Name of model component. Set to model by default.
Nothing
This is an auxiliary function to help guide the definition of utility functions in a choice model. By comparing the predicted and observed shares of alternatives for different categories of the data, it is possible to identify what additional explanatory variables could improve the fit of the model.