From anushiya.thanapalan at hdr.qut.edu.au Tue Oct 12 16:29:55 2021
From: anushiya.thanapalan at hdr.qut.edu.au (Anushiya Thanapalan)
Date: Tue, 12 Oct 2021 05:29:55 +0000
Subject: [Limdep Nlogit List] Clarification
Message-ID:
Hello,
I'm using NLOGIT to run a multinomial logit model. The output did not provide the pseudo R squared value. Rather, it gave the following: R-sqrd = 1 - logL/Logl (constants). What does it all mean? Does this imply that I must perform a manual calculation to determine pseudo R squared? I looked through the documentation but couldn't find a suitable answer.
Regards,
Anushiya
From matenglish123 at gmail.com Fri Oct 29 02:25:20 2021
From: matenglish123 at gmail.com (Mat English)
Date: Thu, 28 Oct 2021 10:25:20 -0500
Subject: [Limdep Nlogit List] MNL model with binary choices
Message-ID:
Hello,
I'm a novice user of NLOGIT, but have used it successfully in the past.
However, this time I'm having troubles modeling with it. I'm working on a
traffic data. Most variables are coded as binary 0,1 (PT in the following
example), while some other are continuous integer such as AGE. Following is
a sample data shown for reference. D1 is there was a delay, D2 means no
delay.
CASEID D1 D2 DELAY WT1 WT2 PT AGE
1 0 1 1 500 0.0862 0 72
1 1 0 0 500 0.0862 0 72
2 0 1 1 250 0.0431 1 72
2 1 0 0 250 0.0431 1 72
3 0 1 1 700 0.1207 0 46
3 1 0 0 700 0.1207 0 46
4 0 1 0 350 0.0603 1 62
4 1 0 1 350 0.0603 1 62
5 0 1 1 1100 0.1897 0 61
5 1 0 0 1100 0.1897 0 61
sum =1
The model code with weight WT1 and output is as follows
RESET;
TIMER;
READ;
NVAR=51;
NOBS=25000;
FILE="C:\...\FILENAME.csv";
NAMES=1$
Last observation read from data file was 1850
|-> NLOGIT;
LHS=DELAY;
CHOICES = D1, D2;
MODEL:
U(TB)= CONST1 + B1*PT + B2*WALK/
U(NTB) = N1*AGE + N2*AUTO ;
WTS=WT1$
-----------------------------------------------------------------------------
Discrete choice (multinomial logit) model
Dependent variable Choice
Weighting variable WT1
Log likelihood function **************
Estimation based on N = 903, K = 5
Inf.Cr.AIC =********* AIC/N = ********
Model estimated: Oct 28, 2021, 09:27:55
R2=1-LogL/LogL* Log-L fncn R-sqrd R2Adj
Constants only must be computed directly
Use NLOGIT ;...;RHS=ONE$
Response data are given as ind. choices
Number of obs.= 925, skipped 22 obs
--------+--------------------------------------------------------------------
| Standard Prob. 95% Confidence
BURDEN| Coefficient Error z |z|>Z* Interval
--------+--------------------------------------------------------------------
CONST1| -.05596*** .00071 -78.89 .0000 -.05735 -.05457
B1| .36310*** .00072 507.59 .0000 .36170 .36450
B2| 2.51819*** .00099 2534.02 .0000 2.51624 2.52014
N1| .12821*** .00013 991.21 .0000 .12796 .12846
N2| -1.32626*** .00063 -2110.81 .0000 -1.32749 -1.32503
--------+--------------------------------------------------------------------
Note: ***, **, * ==> Significance at 1%, 5%, 10% level.
-----------------------------------------------------------------------------
Note that, the LL, R-sqrd and R2Adj are missing in this output but all the
independent variables are significant. With the normalized weight i.e. WT2
the output gets the LL but doesn't show R-sqrd and R2Adj and turns the
variables to non-significant.
-----------------------------------------------------------------------------
Discrete choice (multinomial logit) model
Dependent variable Choice
Weighting variable WT2
Log likelihood function -.28858
Estimation based on N = 903, K = 5
Inf.Cr.AIC = 10.6 AIC/N = .012
Model estimated: Oct 28, 2021, 09:28:09
R2=1-LogL/LogL* Log-L fncn R-sqrd R2Adj
Constants only must be computed directly
Use NLOGIT ;...;RHS=ONE$
Chi-squared[ 4] = .02277
Prob [ chi squared > value ] = .99994
Response data are given as ind. choices
Number of obs.= 925, skipped 22 obs
--------+--------------------------------------------------------------------
| Standard Prob. 95% Confidence
BURDEN| Coefficient Error z |z|>Z* Interval
--------+--------------------------------------------------------------------
CONST1| -.05596 16.88721 .00 .9974 -33.15427 33.04236
B1| .36309 17.02909 .02 .9830 -33.01330 33.73948
B2| 2.51819 23.65697 .11 .9152 -43.84862 48.88499
N1| .12821 3.07921 .04 .9668 -5.90693 6.16336
N2| -1.32626 14.95749 -.09 .9293 -30.64241 27.98989
--------+--------------------------------------------------------------------
Note: ***, **, * ==> Significance at 1%, 5%, 10% level.
-----------------------------------------------------------------------------
I don't understand what's causing this and which is the correct approach.
Since, there are only two outcomes that are exhaustive and mutually
exclusive, I also tried a binary logit model which gives me a weird output.
LOGIT;
LHS=DELAY;
CHOICES = D1, D2;
RHS = ONE,PT,WALK,AGE,AUTO ; WTS=WT1$
-----------------------------------------------------------------------------
Binary Logit Model for Binary Choice
Dependent variable BURDEN
Weighting variable WT1
Log likelihood function **************
Restricted log likelihood**************
Chi squared [ 4 d.f.] .00000
Significance level 1.00000
McFadden Pseudo R-squared .0000000
Estimation based on N = 1850, K = 5
Inf.Cr.AIC =********* AIC/N = ********
Model estimated: Oct 28, 2021, 09:33:51
Corrected for Choice Based Sampling
Hosmer-Lemeshow chi-squared = .05435
P-value= 1.00000 with deg.fr. = 8
--------+--------------------------------------------------------------------
| Standard Prob. 95% Confidence
BURDEN| Coefficient Error z |z|>Z* Interval
--------+--------------------------------------------------------------------
Constant| 0.0 .00042 .00 1.0000 -.82486D-03 .82486D-03
PT| 0.0 .00049 .00 1.0000 -.97015D-03 .97015D-03
WALK| 0.0 .00055 .00 1.0000 -.10809D-02 .10809D-02
EDUC| 0.0 .4255D-06 .00 1.0000 -.83401D-06 .83401D-06
AUTO| 0.0 .00043 .00 1.0000 -.84621D-03 .84621D-03
--------+--------------------------------------------------------------------
Note: nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx.
Note: ***, **, * ==> Significance at 1%, 5%, 10% level.
-----------------------------------------------------------------------------
Can you kindly explain which one is the correct modeling approach and which
weight should be used.
Regards,
Matt
ReplyForward
From khlim2 at gmail.com Sat Oct 30 05:56:38 2021
From: khlim2 at gmail.com (KH Lim)
Date: Fri, 29 Oct 2021 13:56:38 -0500
Subject: [Limdep Nlogit List] Censored normal distribution in Mixed Logit
and its correlation
Message-ID:
Hi all,
Suppose I estimate a mixed logit model with two variables. Variable A is
distributed normal (n), and B is distributed censored right normal (m). My
questions are:
1. Is the reported coefficient of B the mean or the mean of B's underlying
normal distribution? For example, if the reported coefficient is 0.5, and
standard deviation is 2, is the mean of B indeed 0.5? Or is it somewhere
more to the right?
2. In the NLOGIT 5 manual, page N-530:
"If you will be mixing distributions, the specification of correlated
parameters, while allowable, produces ambiguous results. The nature of the
correlation is difficult to define. However, the program will have no
unusual difficulty estimating a model in which correlated parameters have
different distributions. "
Is the correlation matrix produced by the estimator subject to such
complications in the case of censored normal distribution? If so, can a
positive correlation still mean "a person who likes A tends to like B"?
Thank you,
Kar Lim
From wgreene at stern.nyu.edu Sun Oct 31 01:10:38 2021
From: wgreene at stern.nyu.edu (William Greene)
Date: Sat, 30 Oct 2021 10:10:38 -0400
Subject: [Limdep Nlogit List] Censored normal distribution in Mixed
Logit and its correlation
In-Reply-To:
References:
Message-ID:
Dear Kar Lim. First, I'll assume you mean that the coefficients on "A" and
"B" are random with normal and censored normal distributions.
(1). beta(i) = Min(0,beta+sigma*w(i)) where w(i) ~ N[0,1]. In your
example,
beta = .5 and sigma = 2. The mean E[beta(i)] is somewhere left of zero.
You can use the laws of probability, E[.] = 0*Prob(beta+sigma*w(i)>=0)
+ Prob(<0) * E[<=0], which is a little involved. The actual value for your
example is about -0.6. What is reported is the (beta,sigma).
(2) The correlation matrix applies to the underlying primitives. For your
example, if the coefficient on A is gamma = .3 + 3*v(i), the correlation
reported is that between gamma and (beta+sigma*w(i)). The correlation
of the truncated variable will be somewhat less, since after the truncation,
there is variation in gamma that is not accompanied by variation in
beta_sigma*w.
I'm not sure a positive correlation could always mean
"a person who likes A tends to like B."
For your specific examples, I would say that a positive correlation of the
primitives
would indeed accompany a positive correlation of gamma with beta. I'm not
sure
about your qualitative interpretation, however.
Regards,
Bill Greene
On Fri, Oct 29, 2021 at 2:57 PM KH Lim wrote:
> Hi all,
>
> Suppose I estimate a mixed logit model with two variables. Variable A is
> distributed normal (n), and B is distributed censored right normal (m). My
> questions are:
>
> 1. Is the reported coefficient of B the mean or the mean of B's underlying
> normal distribution? For example, if the reported coefficient is 0.5, and
> standard deviation is 2, is the mean of B indeed 0.5? Or is it somewhere
> more to the right?
>
> 2. In the NLOGIT 5 manual, page N-530:
> "If you will be mixing distributions, the specification of correlated
> parameters, while allowable, produces ambiguous results. The nature of the
> correlation is difficult to define. However, the program will have no
> unusual difficulty estimating a model in which correlated parameters have
> different distributions. "
>
> Is the correlation matrix produced by the estimator subject to such
> complications in the case of censored normal distribution? If so, can a
> positive correlation still mean "a person who likes A tends to like B"?
>
> Thank you,
> Kar Lim
> _______________________________________________
> Limdep site list
> Limdep at mailman.sydney.edu.au
> https://protect-au.mimecast.com/s/FzGnCGv0oyC1KMqjqSKZgk6?domain=limdep.itls.usyd.edu.au
>
>
--
William Greene
Department of Economics, emeritus
Stern School of Business, New York University
44 West 4 St.
New York, NY, 10012
URL: https://protect-au.mimecast.com/s/y9WDCJyBrGfq3Yy0yiGYsiA?domain=people.stern.nyu.edu
Email: wgreene at stern.nyu.edu
Editor in Chief: Journal of Productivity Analysis
Editor in Chief: Foundations and Trends in Econometrics
Associate Editor: Economics Letters
Associate Editor: Journal of Business and Economic Statistics