bws.apollo {support.BWS} | R Documentation |
Converting a dataset into that for Apollo
Description
This function converts a dataset generated using bws.dataset
into that in a format suitable for a modeling analysis using the apollo package.
Usage
bws.apollo(data, detail = FALSE)
Arguments
data |
A data frame containing the output from the function |
detail |
A logical value: if |
Details
This function converts a dataset generated using bws.dataset
into that in a format suitable for the modeling analysis using the apollo package. The apollo is a comprehensive package for choice modelling. The format of a dataset suitable for apollo differs from that for clogit
in survival, mlogit
in mlogit, and gmnl
in gmnl. The former assumes that a row corresponds to a question, while the latter assumes that a row corresponds to an alternative. Therefore, the output from bws.dataset
, which is suitable for clogit
, mlogit
, and gmnl
, has to be converted into a dataset for the modeling analysis using apollo.
Value
The function bws.apollo
returns a data frame that contains variables id
, Q
, and RES
, as well as independent variables in a simple format. While the variable id
is assigned to indivID
used in the section “Definition of core settings” of Apollo's model estimation script, the variable RES
is assigned to choiceVar
used in the section “Likelihood definition”. The serial number of alternatives is appended to the tail of the independent variable name: e.g., Item1.1
for the first alternative, Item1.2
for the second alternative, and Item1.3
for the third alternative. The independent variables are also used in the section “Likelihood definition”. The detailed format dataset includes variables that are not used for the analysis with Apollo. For details on Apollo's model estimation script, refer to the vignette (https://cran.r-project.org/package=apollo) and the the user manual (Hess and Palma 2019b).
Author(s)
Hideo Aizaki
See Also
support.BWS-package
, bws.dataset
, clogit
, mlogit
, gmnl
, apollo_estimate
, apollo_mnl