Questions tagged [multinomial]

The multinomial distribution provides a probability distribution over three or more possible outcomes. It generalizes the more fundamental binomial distribution (two outcomes).

In probability theory, the multinomial distribution generalizes the binomial distribution to three or more outcomes.

Suppose two chess players had played numerous games, from which we estimate that Player A would win with probability 0.40, Player B would win with probability 0.35, and the probability that the game ends in a draw is 0.25. The multinomial distribution can be used to answer questions like:

  1. If these two chess players played 12 games, what is the expected number of wins, losses, and draws for player A?
  2. If these two chess players play 3 games, what is the probability that A wins one, B, wins one, and they draw on the other?

Binary classification/prediction methods (such as logistic regression) can also be generalized for multinomial outcomes (i.e., three or more class labels). Multinomial logistic regression is also sometimes called a maximum entropy (MaxEnt) model.

421 questions
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

multinomial logit regression by hand in R

I am trying to implement multinomial regression (mlogit or multinom package) in R with Codes and optim (Not using packages). rm(list= ls()) data = read.table("~/Desktop/R Code/textfiles/keane.csv", sep = ",",header = T) data1 =…
John
  • 23
  • 2
2
votes
0 answers

Is there a way to get the standard errors for a multinomial logistic regression model using ggpreeict

Is there a way to use ggpredict and get the standard errors (or confidence intervals) for predicted probabilities of a multinomial logistic regression model using multinom and ggpredict? Thank you. var1<-sample(c('A', 'B', 'C'), size=1000,…
spindoctor
  • 1,719
  • 1
  • 18
  • 42
2
votes
1 answer

could not find function "multinom" nnet error + stargazer problem

I am trying to run the following multinomial regression specified as follows and get the table as an html through stargazer: ml1 <- multinom(as.factor(stabgroupsTH) ~ factor(pre_stab_group2) + factor(educ2) + agesup + black + male + mhd +…
skol
  • 21
  • 2
2
votes
1 answer

Compare multinom to stan multi logit regression

I'm trying to understand/reproduce findings using stan. However, I'm stuck somewhere. Am I using the wrong stan model? library(nnet);library(rstan);library(dplyr);library(tidyr) #set up data n <- 100 set.seed(1) dat <-…
Thomas
  • 1,392
  • 3
  • 22
  • 38
2
votes
1 answer

How to sample from a multinomial distribution?

Lets assume that I have a set of probabilities [0.1, 0.6, 0.2, 0.1]. I want to sample the locations from this set of probabilities. e.g. when I sample I should get the location 1 quite often than other locations. I know I can implement this in…
user570593
  • 3,420
  • 12
  • 56
  • 91
2
votes
1 answer

Estimation of Multinomial Mixed Effects Models in glmer

I have categorized a patient's pattern of screening for a disease (annual, biennial, or else) and would now like to regress patient demographics on this pattern while adjusting for primary care provider (PCP) characteristics. I'm quite sure this…
2
votes
0 answers

Wald/LRT/Score Hypothesis test in R for multinomial model

For multinomial and ordinal models in R via the nnet package and MASS package, respectively, how do I get an LRT, Wald test, and Rao score test for the full model and various groups of coefficients within the model? For example, given the following…
Michael
  • 111
  • 9
2
votes
1 answer

Formatting multiple models on top of each other in stargazer

I want to format multiple univariate model outputs on top of one another using stargazer (with the same dependent variable), and I can't get them to not show up side-by-side. data(iris) stargazer(multinom(Species ~ Sepal.Length, data = iris), …
T.P.
  • 87
  • 1
  • 6
2
votes
3 answers

Random number generation from multinomial distribution in R using rmultinom() function

I would like to generate a sample of size 20 from the multinomial distribution with three values such as 1,2 and 3. For example, the sample can be like this sam=(1,2,2,2,2,3,1,1,1,3,3,3,2,1,2,3,...1) the following code is working but not getting the…
Uddin
  • 754
  • 5
  • 18
2
votes
0 answers

Reference category or class for multinomial regression

Following this (https://stats.stackexchange.com/questions/125235/glmnet-which-is-the-reference-category-or-class-in-multinomial-regression). I have 3 categories or classes or responses variable: Case (reference group) group1 group2 When I run fit…
Yuvi
  • 21
  • 1
2
votes
1 answer

R multiple logistic regression (mlogit package)

I try to estimate multinomial logistic regression by using mlogit package, but I got the error. I have 205109 observations and below I attempted the code and error. > Data <- read.csv("NWEScsv.csv",header=T) > colnames(Data) [1] "NWSE" "W.S" …
SEIKA UTA
  • 21
  • 3
2
votes
1 answer

Random Variable part in gmnl (R); Error: Random Variable are not in the data

Error Message in Random Parameter Part in gmnl code: "The following random variables are not in the data" I'm estimating a mixed MNL model, however, the gmnl keeps giving me the error message suggesting that the random part variable is NOT in the…
Zoe
  • 21
  • 1
2
votes
1 answer

How should I interpret the results of function multinom in R?

I have a dataset with five categorical variables. And I ran a multinomial logistic regression with the function multinom in package nnet, and then derived the p values from the coefficients. But I do not know how to interpret the results. The p…
A. Caikov
  • 51
  • 5
2
votes
0 answers

`TruncNorm: lower bound is greater than upper bound` Error in MNP package

I'm using the MNP package to fit Bayesian multinomial probit models to categorical data. I frequently get this error: TruncNorm: lower bound is greater than upper bound. How can I resolve this problem? My sense is that this might be a convergence…
FlacoT
  • 121
  • 2