McFadden R^2 and Likelihood Ratio Test not shown in mLogit in R

1.7k views Asked by At

My problem is rather straightforward to understand but I was not able to find a solution.

I am using the following code in R using the mLogit library:

library("mlogit")
dat = read.csv("ExpeData.csv",  header = TRUE)
ExpData<- mlogit.data(dat,shape="wide", varying = 3:14, choice = "Choice",sep=".")
wrf<- mlogit(Choice ~ price+distance+inveh+onoff+prob|0, ExpData)
summary(wrf) 

The output I get is the following:

Call:
mlogit(formula = Choice ~ price + distance + inveh + onoff + 
    prob | 0 , data = ExpData, method = "nr", print.level = 0)

Frequencies of alternatives:
   alt1    alt2 
0.51431 0.48569 

nr method
4 iterations, 0h:0m:0s 
g''(-H)^-1g = 1.55E-07 
gradient close to zero 

Coefficients :
            Estimate  Std. Error  t-value  Pr(>|t|)    
price    -7.3472e-01  3.1842e-02 -23.0735 < 2.2e-16 ***
distance -5.8012e-04  6.6842e-05  -8.6790 < 2.2e-16 ***
inveh    -1.0994e-02  4.5466e-03  -2.4180 0.0156048 *  
onoff     1.1858e-01  3.4718e-02   3.4157 0.0006363 ***
prob      5.6877e-01  8.2690e-02   6.8784 6.053e-12 ***

---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Log-Likelihood: -2912.3

I would like to get the McFadden and Likelihood ratio test

What is wrong??

3

There are 3 answers

0
Manos C On BEST ANSWER

To answer my own questions, it was not that I did not understand the usage of MC Fadden R^2 or the test. My issue was that the R^2 was not presented in the model summary.

My R version was 2.*. Lately I upgraded my computer and got the 3.1.3 version which solved my problems. Now the results of the model summary include:

Log-Likelihood: -7205.8 McFadden R^2: 0.067533 Likelihood ratio test : chisq = 1043.7 (p.value = < 2.22e-16)

and I don't have to estimate the R^2 by hand.

0
IRTFM On

I'm leaving the search for McFadden to you. You should have done that before posting. To do a LRT you need to compare two models one with you covariate(s) of interest and a smaller model without it/them. Modifying the example in ?lrtest:

library("mlogit")
data("TravelMode", package = "AER")
ml <- mlogit(choice ~ wait + travel + vcost, TravelMode,
             shape = "long", chid.var = "individual", alt.var = "mode")
ml0 <- mlogit(choice ~ 1, TravelMode,
               shape = "long", chid.var = "individual", alt.var = "mode")
 lrtest(ml,ml0)
#---------------------
Likelihood ratio test

Model 1: choice ~ wait + travel + vcost
Model 2: choice ~ 1
  #Df  LogLik Df  Chisq Pr(>Chisq)    
1   6 -192.89                         
2   3 -283.76 -3 181.74  < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
0
bpar On

For others who might be experiencing a similar issue. These statistics (McFadden's and LRT) are not reported if you are running a random parameter model (e.g. MIXL) within mlogit. The null log-likelihood is not estimated in this case, and there is no null LL value. You can do this manually as mentioned above (i.e. estimate the null model with just the intercept, and then your full model).