Converts multinomial logit data into a combination of several binary logit data sets, in order to analyze it via the Begg & Gray approximation using a binary logistic regression.
mlogit2logit(f, data, choices = NULL, base.choice = 1,
varying = NULL, sep = ".")
List with components:
Converted data set.
Formula to be used with the converted data set.
Number of observations in the original data set.
Index of all \(Z\) columns within data
(see vignette for details), i.e. columns that correspond to alternative specific constants.
Names of the \(Z\) columns.
List in which each element corresponds to any of the data
columns that involve \(Z\), which is either \(Z\) itself or an interaction between a variable and \(Z\), (see vignette). The value of such element is a vector with the components ‘name’: either \(Z\) itself, or name of the corresponding \(X\) or \(U\) variable with which \(Z\) interacts; ‘choice’: which alternative it belongs to; ‘intercept’: logical determining if it is an alternative specific constant.
Vector of names of the alternatives.
Index of alternative within choices
that corresponds to the main intercept of the binary logistic model.
Formula as described in Details of mnl.spec
.
Data frame containing the variables of the model.
Vector of names of alternatives. If it is not given, it is determined from the response column of the data frame. Values of this vector should match or be a subset of those in the response column. If it is a subset, data
is reduced to contain only observations whose choice is contained in choices
.
Index of the base alternative within the vector choices
.
Indices of variables within data
that are alternative-specific.
Separator of variable name and alternative name in the ‘varying’ variables.
Hana Sevcikova
Details of the conversion algorithm are described in the vignette of this package, see vignette('conversion')
.
Begg, C.B., Gray, R. (1984) Calculation of polychotomous logistic regression parameters using individualized regressions. Biometrika 71, 11--18.
Yeung, K.Y., Bumgarner, R.E., Raftery, A.E. (2005) Bayesian model averaging: development of an improved multi-class, gene selection and classification tool for microarray data. Bioinformatics 21 (10), 2394--2402.
mnl.spec
data(heating)
bin.data <- mlogit2logit(depvar ~ ic + oc, heating, choices=1:5,
varying=3:12, sep='')
bin.glm <- glm(bin.data$formula, 'binomial', data=bin.data$data)
summary(bin.glm)
Run the code above in your browser using DataLab