Questions tagged [mlogit]

Multinomial logistic regression is a classification method that generalizes logistic regression to multiclass problems.

Multinomial Logistic Regression

In statistics, multinomial logistic regression is a classification method that generalizes logistic regression to multiclass problems, i.e. with more than two possible discrete outcomes. That is, it is a model that is used to predict the probabilities of the different possible outcomes of a categorically distributed dependent variable, given a set of independent variables (which may be real-valued, binary-valued, categorical-valued, etc.).

Multinomial logistic regression is known by a variety of other names, including multiclass LR, multinomial regression, softmax regression, multinomial logit, maximum entropy (MaxEnt) classifier, conditional maximum entropy model.

Source: http://en.wikipedia.org/wiki/Multinomial_logistic_regression

289 questions
3
votes
0 answers

mlogit Error in solve.default(H, g[!fixed]) : Lapack routine dgesv: system is exactly singular: U[2,2] = 0

I want to transform my data to a mlogit.data and I did this a<- mlogit.data(Fit.Train.KNN, choice ="Vote", shape = c("wide"), alt.levels = c( "Scioli","Macri", "Massa", "Carrio", "Sanz ","Stolbizer", "Indecisos",…
marco
  • 31
  • 1
3
votes
1 answer

How to build AIC model selection table using mlogit models

I'm trying to build an AIC table for my candidate set of models in R, which were run using mlogit. I've used glm and glmer in the past, and have always used the package AICcmodavg and aictab to extract values and create a model selection table. This…
3
votes
1 answer

Strange behavior of the effects command of mlogit in R

I am estimating a multionomial logit model and would like to report marginal effect. I am running into a difficulty, as when I am using a larger version of the model I get an error. Here is an reproducible example. The following code, with two…
splinter
  • 3,727
  • 8
  • 37
  • 82
3
votes
4 answers

finding if boolean is ever true by groups in R

I want a simple way to create a new variable determining whether a boolean is ever true in R data frame. Here is and example: Suppose in the dataset I have 2 variables (among other variables which are not relevant) 'a' and 'b' and 'a' determines a…
olga
  • 99
  • 9
3
votes
2 answers

Formatting data for mlogit

I am having a murderous time getting my data set in shape for a multinomial logit analysis via mlogit. My data set is available from the url in the code below. I'm getting the following error: Error in row.names<-.data.frame(*tmp*, value =…
spindoctor
  • 1,719
  • 1
  • 18
  • 42
3
votes
2 answers

R mlogit model, computationally singular

I've spent the whole of today first battling with formatting my data (updated after finding a bug via BondedDust's table(TM) suggestion) appropriately for mLogit: raw <-read.csv("C:\\Users\\Andy\\Desktop\\research\\Oxford\\Prefs\\rData.csv",…
andyw
  • 3,505
  • 2
  • 30
  • 44
3
votes
1 answer

Extracting Independent variables List from a mlogit object

I am using following package: library(mlogit) My data is prepared as follows data(CollegeDistance, package="AER") testdata <- CollegeDistance testdata$Dist[testdata$distance<0.4] <- 1 testdata$Dist[testdata$distance<1 & testdata$distance>=0.4] <-…
Milad
  • 339
  • 2
  • 12
3
votes
2 answers

How to solve mlogit marginal effects error?

After successfully running the mlogit model in R, I get an error trying to obtain marginal effects that says: "Error in predict.mlogit(object, data) : the number of rows of the data.frame should be a multiple of the number of alternatives" I have…
Ed.
  • 31
  • 4
3
votes
0 answers

Mlogit multinomial probit model: missing value where TRUE/FALSE needed

I am trying to use the mlogit package to estimate a multinomial probit model, but I get the following error. Error in if (is.null(initial.value) || lnl <= initial.value) break : missing value where TRUE/FALSE needed These are the statements…
user3482499
  • 123
  • 1
  • 8
3
votes
0 answers

Strange error with multinomial logit regression in R

I tried to do multinomial logit regression in R. I used the following command: fit <- glmnet(xdata, newdata2$state, family="multinomial" ) but I got this error: Error: from glmnet Fortran code (error code 8001); Null probability for class 1 <…
user54626
  • 55
  • 7
3
votes
1 answer

Organize results produced by mlogit in vertical columns

I am trying to organize my results obtained with mlogit for exporting to LaTeX with xtable. However, I am finding it difficult to prepare the results in adjacent columns as often found in academic publications. In particular, I am having problems…
ZMacarozzi
  • 697
  • 1
  • 5
  • 11
2
votes
2 answers

Multiple imputation and mlogit for a multinomial regression

I am trying to run a multinomial regression with imputed data. I can do this with the nnet package, however I want to use mlogit. Using the mlogit package I keep getting the following error "Error in 1:nrow(data) : argument of length 0". So making…
itsapuntis
  • 35
  • 5
2
votes
1 answer

How to get the standard errors for marginal effects calculated by effects() in mlogit

I am currently conducting (conditional) multinomial logistic regression analyses using the mlogit package in R. The standard output of these models are coefficients, standard errors, and their significance level. As these coefficients can be hard to…
2
votes
1 answer

sandwich + mlogit: `Error in ef/X : non-conformable arrays` when using `vcovHC()` to compute robust/clustered standard errors

I am trying to compute robust/cluster standard errors after using mlogit() to fit a Multinomial Logit (MNL) in a Discrete Choice problem. Unfortunately, I suspect I am having problems with it because I am using data in long format (this is a must in…
2
votes
1 answer

issue with mlogit package related to modalities

I am using the mlogit package to run a multinomial mixed effect model. The data are in the long format to begin with. I am trying to determine whether a variable is related to differences in a categorical outcome, sleep duration, that has 3…
Jill Alex
  • 21
  • 3
1 2
3
19 20