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

Fixing computationally singular error in R mlogit package

I am using mlogit package in R for random utility model: https://www.jstatsoft.org/article/view/v095i11#:~:text=mlogit%20is%20a%20package%20for,random%20parameter%20models)%20are%20implemented. The dependent variable "choice" depends on alternative…
0
votes
0 answers

EError in solve.default(crossprod(attr(x, "gradi")[, !fixed])) : system is computationally singular: reciprocal condition number = 6.85548e-36

I am new to R statistics, I am trying to do a choice experiment model with 2 alternatives and one opt-out option. the alternatives have 6 attributes with 2 levels each. I used effect coding to code the variables with 869 observations. I tried to do…
Nattie
  • 1
  • 1
0
votes
1 answer

Partially Degenerate Nested Logit in R (Currently trying Mlogit, but open to other packages)

I am trying to run a Nested Logit with a partial degeneracy. That means that one of my lower nests only had one option. Graphically, this is represented by the picture below [not my picture, it is from Hunt (2000)]. In my case, the upper nest is…
RobertoAS
  • 45
  • 6
0
votes
0 answers

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

please am very new in r statistics so any help will be appreciated. I am trying to analyse a discrete choice data with two alternatives and an opt out option using the nested logit model in R. I did this; data1 <- mlogit.data(data=ose,shape="long",…
Nattie
  • 1
  • 1
0
votes
0 answers

how to prepare dataframe for discrete choice experiment with opt-out option

please am very new in r statistics so any help will be appreciated. I conducted a discrete choice experiment that has 2 alternatives (A and B) with an opt-out option (C), each alternative have 6 attributes with 2 levels. I have 869 respondents. I…
Nattie
  • 1
  • 1
0
votes
0 answers

Chi square test vs binomial logit

my data looks like this: I have two groups of people - Students and the elderly. 59 out of 266 students said "YES" 23 out of 127 elderly people said "YES" The rest said "no" I am trying to find out where this difference in their answers is…
vojta9
  • 9
  • 3
0
votes
0 answers

Basinhopping Causes Error with Statsmodels MNLogit

I tried running the code below to fit a multinomial Logit model using the basinhopping method, but it returns the following error: import numpy as np import statsmodels.api as sm x = np.random.randint(0, 100, 1000) y = np.random.randint(0, 3,…
0
votes
0 answers

Calculation of price elasticities with mlogit (mixed logit)

I estimated a mixed logit model with the mlogit package. My data has the following structure: long format individual id ("id) alternative A, B, C D that represent four car types ("alternative") choice situation ("card") I estimated a mixed logit…
Rosanne
  • 11
  • 1
0
votes
1 answer

Trying to create a data frame for mlogit and keep running into this error Error in names(data)[ix] : invalid subscript type 'language'

I am trying to use this data set https://data.cityofnewyork.us/Transportation/Citywide-Mobility-Survey-Person-Survey-2019/6bqn-qdwq to create an mnl model but every time I try to change my original data frame like this nydata_df = dfidx(nydata,…
0
votes
0 answers

Statsmodel returns different answers for the same variable

So I am running a statsmodel code for Logit to compare statistical significance. I am doing one on one classification. My model results return duplicate answers for the same variable with at times opposite coefficients( negative for one and postive…
0
votes
0 answers

Random effects (more than one) in multinomial regression in R (mblogit)

I'm trying to run a multinomial regression for the first time. I am attempting to build the code based on a built-in dataset, but I'm having trouble getting it to do what I need. I want to run a model with random effects only. Here is the code with…
Agata
  • 343
  • 3
  • 13
0
votes
0 answers

Estimate a latent class logit model in R? -varying' arguments must be the same length

I am trying to estimate a latent class logit model using panel data. I tried following this example: https://rpubs.com/msarrias1986/335556. I was told that the following code should work: RM <- mlogit.data(rm01, id.var = "ID", choice =…
Ping Guo
  • 1
  • 1
0
votes
0 answers

Mlogit predictions with all ind variables

I am trying to make a prediction on a multinomial logit equation using the mlogit package, the problem I am having when trying to calculate the prediction using the new data I am receiving the following error Error in contrasts<-(*tmp*, value =…
mj10
  • 19
  • 4
0
votes
0 answers

gmnl package, mixed logit 'mixl' Error: $ operator is invalid for atomic vectors

I am seeing this error is appearing with various other packages,for instance here, but the solutions do not seem to apply here. I am using the gmnl package and want to do a mixed logit, but run on the following error Error: $ operator is invalid for…
0
votes
0 answers

Using mlogit.data() gives error: r error 4 (Error in `[.data.frame`(x, start:min(NROW(x), start + len)) : undefined columns selected )

I'm trying to change the format so that all the prices are under one column. End goal is to run a “mixed” multinomial logit model, hence the mlogit.data() function. Everything runs fine until you try to open the data frame. that's when I get this…
bandcar
  • 649
  • 4
  • 11