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

mlogit error: "model system is computationally singular" and "subscript out of bounds"

I have the following dataframe X: chid.var id.var alt.var wei odd cou cla pla 1 1 1 130 6.6 0 5 1 1 1 2 119 224 0 5 0 1 1 3 126 10 0 5 0 1 1 4 …
Ishigami
  • 181
  • 7
1
vote
0 answers

mlogit error - Error - replacement has x rows, data has y. Error in `$<-.data.frame`(`*tmp*`, "id1", value = c(1L, 1L, 1L, 1L, 1L, :

I have created a data frame in Python which doesn't contain any NA values: print(df.empty == True) and I got False as output. When I import the data frame to R using the mlogit library: library("mlogit") X <- read.csv("/Users/abc/df.csv") df <-…
Ishigami
  • 181
  • 7
1
vote
1 answer

mlogit package in R error column name "" cannot match any column

I am using the mlogit package in R and trying to run mlogit on the Train dataset that is available in the package. Here is my code: mlogit.data(Train,shape='wide',choice = "choice", varying = 4:11, sep = "",alt.levels = c(1,2), id = "id") I get the…
riskiem
  • 187
  • 2
  • 7
1
vote
1 answer

How to export margins of odered logit model from R to latex?

I am running an ordered logit model using the package: oglmx After running the regression, I calculated the margins using: oglmx.margins. However, I cannot export this output to latex or word or excel. I have tried stargazer, export_summs, and…
Akshara
  • 11
  • 2
1
vote
0 answers

How to correct standard errors standard errors in a multinomial logit using IV

I am trying to estimate a multinomial logit model using an instrumental variable. I didn't find any preexisting package, so I tried to estimate using a two-stage approach. First estimating the first stage as an OLS with the IV tsls1<-lm(d~x+z) Then…
1
vote
1 answer

Estimating parameters using stan when the distribution for response variable in a regression is non-normal - Part 2

This is an extension of my previous post here Estimating parameters using stan when the distribution for response variable in a regression is non-normal. Let say I have below data dat = list(y = c(0.00792354094929414, 0.00865300734292492,…
Bogaso
  • 2,838
  • 3
  • 24
  • 54
1
vote
1 answer

Why will this csv file not load in R mlogit?

SOLVED This has been blowing up my head all afternoon I simply cannot figure out why I cannot run mlogit on this simple data set small…
Moneyball
  • 13
  • 3
1
vote
1 answer

Simulate Nested Logit Errors

I'm trying to simulate data that can be estimated using a nested logit model. If epsilon is distributed nested logit with a nesting structure $B_1, ..., B_K $, and nesting parameters $\lambda_1, ... \lambda_K$ then the CDF of epsilon is I am…
EB727
  • 43
  • 5
1
vote
0 answers

`gmnl` unable to include Alternative Specific Constants (ASC) in Mixed-mixed MNL model

I am trying to estimate a Mixed-mixed multinomial logit model using the gmnl package. It works perfectly when not including Alternative Specific Constants (ASC), but it produces a weird error when incorporating them. The code below was taken (and…
1
vote
0 answers

Mixed models with mlogit in R - Random intercepts?

I want to fit a very simple mixed-effects model, with a couple of fixed effects and random intercepts (no random slopes), using the mlogit package in R. My categorical outcome variable has three levels, so I cannot use the lme4 package. However, I…
persboe
  • 71
  • 1
  • 5
1
vote
0 answers

Error in t.default(x) : argument is not a matrix

I am trying to see what people's willingness to pay is for either nuclear or wind energy (far away or local) through a stated choice preference. I used the multinomial logit model, however when estimating the discreet choice for the different…
Bas
  • 11
  • 1
1
vote
2 answers

"No Individual Index" Error Mixed Model Mlogit R

I'm estimating a mixed model on data from a discrete choice experiment with an opt-out alternative (alternative C). I define the individual, but I still get the error message "no individual index" and the model is not estimated. A screenshot of my…
Rosanne
  • 11
  • 1
1
vote
0 answers

mlogit : impossible to coerce the choice variable to a logical

I have created an artificial data for mlogit with each person given 4 choices in two sets. However I am getting impossible to coerce the choice variable to a logical error while trying to apply the model. I have seen the following link but it is not…
Soumya Boral
  • 1,191
  • 14
  • 28
1
vote
1 answer

R hmftest multinomial logit model " system is computationally singular"

I have a multinomial logit model with two individual specific variables (first and age). I would like to conduct the hmftest to check if the IIA holds. My dataset looks like this: head(df) mode choice first age 1 both 1 0 24 2 pre …
1
vote
1 answer

Similar function to R's logsum function (mlogit package) for Survival package

I was trying to obtain the expected utility for each individual using R's survival package (clogit function) and I was not able to find a simple solution such as mlogit's logsum. Below I set an example of how one would do it using the mlogit…
John Doe
  • 212
  • 1
  • 9
  • 28