apollo_classAlloc: Calculates class allocation probabilities for a Latent Class...

View source: R/apollo_classAlloc.R

apollo_classAllocR Documentation

Calculates class allocation probabilities for a Latent Class model

Description

Calculates class allocation probabilities for a Latent Class model using a Multinomial Logit model and can also perform other operations based on the value of the functionality argument.

Usage

apollo_classAlloc(classAlloc_settings)

Arguments

classAlloc_settings

List of inputs of the MNL model. It should contain the following.

  • utilities: Named list of deterministic utilities . Utilities of the classes in class allocation model. Names of elements must match those in avail, if provided.

  • avail: Named list of numeric vectors or scalars. Availabilities of classes, one element per class Names of elements must match those in classes. Values can be 0 or 1. These can be scalars or vectors (of length equal to rows in the database). A user can also specify avail=1 to indicate universal availability, or omit the setting completely.

  • rows: Boolean vector. Consideration of which rows to include. Length equal to the number of observations (nObs), with entries equal to TRUE for rows to include, and FALSE for rows to exclude. Default is "all", equivalent to rep(TRUE, nObs).

  • componentName: Character. Name given to model component. If not provided by the user, Apollo will set the name automatically according to the element in P to which the function output is directed.

Value

The returned object depends on the value of argument functionality, which it fetches from the calling stack (see apollo_validateInputs).

  • "components": Same as "estimate".

  • "conditionals": Same as "estimate".

  • "estimate": List of vector/matrices/arrays with the allocation probabilities for each class.

  • "gradient": List containing the likelihood and gradient of the model component.

  • "output": Same as "estimate".

  • "prediction": Same as "estimate".

  • "preprocess": Returns a list with pre-processed inputs, based on classAlloc_settings.

  • "raw": Same as "estimate".

  • "report": Same as "estimate".

  • "shares_LL": List with probabilities for each class in an equal shares setting.

  • "validate": Same as "estimate", but it also runs a set of tests to validate the function inputs.

  • "zero_LL": List with probabilities for each class in an equal shares setting.


apollo documentation built on Oct. 2, 2024, 1:08 a.m.