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
1 answer

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

I have a data frame with several thousand rows and only a few columns. I have pasted a portion of my code below. I am looking at the "Section" preferences of individuals and want to know what might be influencing their choice (e.g., density, area).…
crew4u
  • 45
  • 9
0
votes
0 answers

error involving unique observations using mlogit

I am trying to run a mixed effect multinomial model. Below is some of my data. id outcome x 1008 two -0.36759425 1008 two -0.36759425 1008 two -0.36759425 1008 two …
D. Fowler
  • 601
  • 3
  • 7
0
votes
0 answers

Unexpected error - regression model using glm

I am trying to do a regression using glm but it is coming with an unexpected error Here is the code: mod1 <- glm(N_agreements ~ Population + PublicStaff + Macrorregion + Direct Plan, data = ILC, family = binomial) summary(mod1) the message: Error:…
0
votes
0 answers

Configure data frame of hundreds of choice set for nested choice model in R using mlogit package

I want to model car purchase choice using nested logit approach. The data that I used currently is hypothetical since I want to make myself sure how to handle them before doing the actual questionnaire. The data contains 1,000 hypothetical choice…
0
votes
1 answer

How do I run a same code over in R for logit?

I am trying to get R to run the same function/code but for a dataset. I have it set up with 50 questions, yes(1)/no(0) answers and about 500 different responses for each of the 50 questions. The 500 responses are identified as male(1) or female(0).…
0
votes
0 answers

How to apply restrictions on parameters of mixed logit model in R mlogit package

I would like to estimate a mixed logit model with some restrictions applied on some of the parameters. Is there a way of doing this in the mlogit package in R? For example, in the model described below I would like to allow the coefficient on…
0
votes
0 answers

Calculation of marginal effects mlogit, Error "Arguments mus have the same length"

I try to calculate the marginal effects after I conducted a multinomial logistic regression using mlogit. reg1 <- mlogit::mlogit(formula = value ~ 1 | ScoreEnvAtt, data = listDatasets[[2]]) reg1 summary(reg1) z <- with(listDatasets[[2]],…
Mariella
  • 21
  • 4
0
votes
1 answer

How to solve mlogit Error in solve.default(H, g[!fixed]) : system is computationally singular: reciprocal condition number = 3.03549e-18?

I have a wide format data, I'm calling mlogit.data And I tried implementing a mixed logit model using mlogit package, I have one hot encoded the categorical columns (color,size_group ) is that causing the below error? numerical features in…
Yashwanth
  • 69
  • 7
0
votes
0 answers

Why am I getting Lapack routine dgesv system is exactly singular error?

I am trying to run a logistic regression with the data structure as follows (The original data has 10 columns and 296 rows in the format as shown in the example): Food d.bri d.cau d.bre d.pea FA FC Delay Agg Rej F1 1 0 …
0
votes
0 answers

How can I estimate a latent class model with individual-specific parameters in R?

I am trying to estimate a latent class model in R based on a discrete choice experiment. Attributes in my choice set were 'COST', 'NUCL', 'REN', 'FOSS' and 'OUTAGE'. I also asked background questions which give me the variables 'MALE', 'NL', 'Y25',…
0
votes
1 answer

How can I estimate a latent class logit model in R?

I am new to using R. 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: df01 <- mlogit.data(data, …
0
votes
0 answers

Python: Find the equation of my line, Logit

I have some data that, when plotted, is looking like it is showing similarities to the LOGIT function. However, I need the equation of this line and I am struggling to find a package/function in Python to help me with this! Below is a screenshot of…
Jim White
  • 13
  • 3
0
votes
3 answers

Convert data from wide to long format keeping all alternatives of the dv and adding a choice variable

I try to get my data to work with the mlogit-package in r. I failed in converting the wide data format to a long format with the mlogit.data command, so I tried it by myself using melt. This is what I have so far (case is a case identifier, dv will…
0
votes
1 answer

Using mlogit inside a for loop giving me an error

for(i in 1:ncol(mldata)) { mlogit.mydata=mlogit(severity ~ 1|mldata[,i],data=mldata) mlogit[i]=summary(mlogit.mydata)$lratio$p.value } It gives the the following error: Error in solve.default(H, g[!fixed]) : Lapack routine dgesv: system is…
Maninder Kaur
  • 53
  • 1
  • 1
  • 3
0
votes
1 answer

scikit-learn Logistic Regression prediction not same as self-implementation

I trained a model using scikit-learn's LogisticRegression classifier (multinomial/multiclass). I then saved the coefficients from the model to a file. Next, I loaded the coefficients into my own self-implementation of softmax, which is what…
Hamman Samuel
  • 2,350
  • 4
  • 30
  • 41