Learn R Programming

apollo (version 0.1.0)

apollo_fitsTest: Compares fit of model across categories

Description

Given the predictions of a model, it compares the fit across categories of observations.

Usage

apollo_fitsTest(model, apollo_probabilities, apollo_inputs, fitsTest_settings)

Arguments

model

Model object. Estimated model object as returned by function apollo_estimate.

apollo_probabilities

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".

apollo_inputs

List grouping most common inputs. Created by function apollo_validateInputs.

fitsTest_settings

List of arguments. It must contain the following elements.

  • 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.

Value

Matrix with average fit per category (invisibly).

Details

Prints a table comparing the average fit for each category.