Learn R Programming

mlogitBMA (version 0.1-9)

mlogit2logit: Converting Multinomial Logit Data into Binary Logit Data

Description

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.

Usage

mlogit2logit(f, data, choices = NULL, base.choice = 1, 
             varying = NULL, sep = ".")

Value

List with components:

data

Converted data set.

formula

Formula to be used with the converted data set.

nobs

Number of observations in the original data set.

z.index

Index of all \(Z\) columns within data (see vignette for details), i.e. columns that correspond to alternative specific constants.

z.names

Names of the \(Z\) columns.

zcols

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.

choices

Vector of names of the alternatives.

choice.main.intercept

Index of alternative within choices that corresponds to the main intercept of the binary logistic model.

Arguments

f

Formula as described in Details of mnl.spec.

data

Data frame containing the variables of the model.

choices

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.

base.choice

Index of the base alternative within the vector choices.

varying

Indices of variables within data that are alternative-specific.

sep

Separator of variable name and alternative name in the ‘varying’ variables.

Author

Hana Sevcikova

Details

Details of the conversion algorithm are described in the vignette of this package, see vignette('conversion').

References

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.

See Also

mnl.spec

Examples

Run this code
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