Learn R Programming

apollo (version 0.2.6)

apollo_choiceAnalysis: Reports market share for subsamples

Description

Compares market shares across subsamples in dataset, and writes results to a file.

Usage

apollo_choiceAnalysis(choiceAnalysis_settings, apollo_control, database)

Arguments

choiceAnalysis_settings

List containing settings for this function. The settings must be:

  • alternatives: Named numeric vector. Names of alternatives and their corresponding value in choiceVar.

  • avail: Named list of numeric vectors or scalars. Availabilities of alternatives, one element per alternative. Names of elements must match those in alternatives. Values can be 0 or 1.

  • choiceVar: Numeric vector. Contains choices for all observations. It will usually be a column from the database. Values are defined in alternatives.

  • explanators: data.frame. Variables determining subsamples of the database. Values in each column must describe a group or groups of individuals (e.g. socio-demographics). Most usually a subset of columns from database.

  • printToScreen: Logical. TRUE for returning output to screen as well as file. TRUE by default.

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

apollo_control

List. Options controlling the running of the code. See apollo_validateInputs.

database

data.frame. Data used by model.

Value

Silently returns a matrix containg the mean ehen chosen and un chose for each explanator, as well as the t-test comparing those means (H0: equivalence). The table is also writen to a file called modelName_choiceAnalysis.csv.

Details

Saves the output to a csv file in the working directory.