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
5
votes
0 answers

Multistage Nested Logit R

I want to estimate a nested logit model using the language R. As standard packages for such problems I am using "mlogit". Now I would like to estimate a model, with more than just one stage. The problem is as follows: Stage: People decide, if they…
ResearchR
  • 91
  • 4
5
votes
1 answer

mlogit.data in R - error in 'row.names<-.data.frame`(`*tmp*`, value = c("

I am trying to setup my data for the mlogit-package in R, but somehow seem to run into trouble. My data-frame is called choice2, and it looks like this: id choice_id mode.ids choice weightloss adveffect inj tab infreq_1 infreq_3 cost 1 x1 …
Hbrandi
  • 171
  • 2
  • 14
4
votes
0 answers

How do you compute average marginal effects for glm.cluster models?

I am looking for a way to compute average marginal effects with clustered standard errors which i seem to be having a few problems with. My model is as follows: cseLogit <- miceadds::glm.cluster(data = data_long, …
4
votes
1 answer

R mlogit package: use LAPACK instead of LINPACK

I am estimating a fairly simple McFadden choice model using a very large data set (101.6 million unit-alternatives). I can estimate this model just fine in Stata using the asclogit command, but when I try to use the mlogit package in R, I get the…
Tyler R.
  • 461
  • 6
  • 15
4
votes
1 answer

Why do I get NAN for p-values while using statsmodels logit function?

My data I used statsmodels to build a logistic regression as follows: X = np.copy(train_data) X = sm_.add_constant(X) model = sm.Logit(train_y, X) result = model.fit(method='bfgs', maxiter=10000) …
MRM
  • 1,099
  • 2
  • 12
  • 29
4
votes
1 answer

Most straightforward R package for setting subject as random effect in mixed logit model

I have a dataset in which individuals, each belonging to a particular group, repeatedly chose between multiple discrete outcomes. subID group choice 1 Big A 1 Big B 2 Small B 2 Small B 2 Small C 3 Big …
jjcii
  • 139
  • 3
  • 10
4
votes
3 answers

Multinomial logit: estimation on a subset of alternatives in R

As McFadden (1978) showed, if the number of alternatives in a multinomial logit model is so large that computation becomes impossible, it is still feasible to obtain consistent estimates by randomly subsetting the alternatives, so that the estimated…
Effa
  • 55
  • 7
4
votes
0 answers

Constrained multinomial logistic regression in R using mlogit

I would like to add some constraints to a multinomial logistic regression model using mlogit in R. For example only look for negative values during coefficient estimation. But apparently the model doesn't have such capabilities. I was wondering if…
Frank
  • 41
  • 2
4
votes
1 answer

Multinomial/conditional Logit Regression, Why StatsModel fails on mlogit package example?

I am trying to reproduce an example of a multinomial logit regression of the mlogit package in R. data("Fishing", package = "mlogit") Fish <- mlogit.data(Fishing, varying = c(2:9), shape = "wide", choice = "mode") #a pure "conditional"…
mth_mad
  • 135
  • 1
  • 10
4
votes
0 answers

BFGS Fails to Converge

The model I'm working on is a multinomial logit choice model. It's a very specific dataset so other existing MNLogit libraries don't fit with my data. So basically, it's a very complex function which takes 11 parameters and returns a loglikelihood…
Titanic
  • 557
  • 1
  • 8
  • 21
3
votes
1 answer

Formula error when running mixed logit model in R

I have created simulated data for a mixed logit model. It involves N anglers taking two trips, each of which can be to one of two sites. Here is the code to create the simulated data: library(data.table) library(mlogit) ### Angler choice…
Charlie
  • 2,801
  • 3
  • 26
  • 27
3
votes
1 answer

multinomial logistic regression results table in wide format using the gtsummary package

I have a dependent variable with four outcomes. I have used the mlogit package to conduct a multinomial logistic regression. When I try to present the results using gtsummary package, my multinomial logistic regression results are stacked on top of…
Mohamed Yusuf
  • 390
  • 1
  • 11
3
votes
1 answer

Error with using the mlogit R function: the two indexes don't define unique observations

I've got a problem with the mlogit funtion in R. My dataset looks like this: personID caseID altID choice a1 a2 a3 a4 1 1 1 1 3 0 3 1 1 1 2 0 1 3 …
Michael Otten
  • 31
  • 1
  • 2
3
votes
2 answers

Error when using mlogit package version 1.1-0. dfidx::dfidx providing id2 is irrelevant

The following is a minimum working example that generates the error. The following code worked in previous versions of mlogit but no longer works in version 1.1-0 (released May 26, 2020). library(mlogit) data("ModeCanada", package =…
Notarobot2244
  • 61
  • 1
  • 6
3
votes
0 answers

How can I use the tidyverse to insert values that fall between a specified range and don't already exist in the column of interest

I have a large tibble with grouped data. Each group includes 12 rows. The third column of the tibble has to have a values between 1 and 12. Most of the rows have all the rows in column 3 populated, but some do not. For those rows with missing data…
Mutuelinvestor
  • 3,384
  • 10
  • 44
  • 75
1
2
3
19 20