Description Usage Arguments Details Value Examples
View source: R/estimation_support.R
Transforms the data into the desired data format required by different estimation packages.
1 
pkg 
Indicates the desired estimation package. Options are

des 
A design matrix in which each row is a profile. 
y 
A numeric vector containing binary or discrete responses. See 
n.alts 
Numeric value indicating the number of alternatives per choice set. 
n.sets 
Numeric value indicating the number of choice sets. 
n.resp 
Numeric value indicating the number of respondents. 
bin 
Logical value indicating whether the reponse vector contains
binary data ( 
alt.names 
A character vector containing the names of the alternatives.
The default = 
The design (des
) specified should be the full aggregated design.
Thus, if all participants responded to the same design, des
will be a repetition of
that design matrix.
The responses in y
should be succesive when there are multiple
respondents. There can be n.sets
elements for each respondent with
discrete values indicating the chosen alternative for each set. Or there can
be n.sets * n.alts
elements for each respondent with binary values
indicating for each alternative whether it was chosen or not. In the latter
case the bin
argument should be TRUE
.
n.sets
indicates the number of sets each repondent responded to. It is
assumed that every responded responded to the same number of choice sets.
The data ready to be used by the specified package.
1 2 3 4 5 6 7 8 9  idefix.data < aggregate_design
des < as.matrix(idefix.data[, 3:8], ncol = 6)
y < idefix.data[, 9]
bayesm.data < Datatrans(pkg = "bayesm", des = des, y = y,
n.alts = 2, n.sets = 8, n.resp = 7, bin = TRUE)
Mix.pro.data < Datatrans(pkg = "Mixed.Probit", des = des, y = y,
n.alts = 2, n.sets = 8, n.resp = 7, bin = TRUE)
mlogit.data < Datatrans(pkg = "mlogit", des = des, y = y,
n.alts = 2, n.sets = 8, n.resp = 7, bin = TRUE)

Loading required package: shiny
[1] "The dataset is ready to be used for bayesm package"
[1] "The dataset is ready to be used for Mixed Probit Estimation"
[1] "The dataset is ready to be used for mlogit package"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.