Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: nlogitrum and nlogit: unbalanced data


From   John Fulton <[email protected]>
To   [email protected]
Subject   Re: st: nlogitrum and nlogit: unbalanced data
Date   Wed, 10 Jan 2007 09:47:33 -0500

Richard Gates suggested modifying nlogitrum to remove a trap. I tried it and it didn't work.
Hi Statalist.
I followed Richard's suggestion to modify -nlogitrum- to "-mynlogitrum-." "-mynlogitrum-" returns the correct tree, then gives an error: "weights must be the same for all observations in a group."

I assume I'm running afoul of another kind of check for balanced data, or possibly a check for degenerate nests.

I didn't need to do it, but I egened min and max weights by group, and selected cases where they were unequal. There were none.

Again, the -nlogit- runs fine.

Thanks,
John.


Richard Gates wrote:

John Fulton is inquiring about the "unbalanced data" error message from
-nlogitrum-.

There is an error trap in -nlogitrum- to check that the alternatives for each
case (individual) are balanced. This error trap is unnecessary. The code in
-nlogitrum- is based on the Stata 7 release of -nlogit-. Since then we (at StataCorp) have determined the restriction that each case must have the
same set of alternatives is unnecessary and we have removed it from -nlogit-.

John, if you are feeling up to a bit of programming you can copy nlogitrum.ado
to your working directory and modify it. You can find where -nlogitrum-
resides using the stata command

. which nlogitrum

It is probably in your personal ado directory.
You will see in the ado code a call to the local program -ChkDta- on line 78.
Comment out this line.
Your ado path will have the working directory ahead of the personal directory.
To check your ado path use

. adopath

Clear the original version of -nlogitrum- from memory using

. program drop _all

then try running your model again.

Alternatively, you could copy nlogitrum.ado to mynlogitrum.ado and
change the program name within the file to mynlogitrum.ado.
Be sure to constrain the inclusive-valued (dissimularity) parameters to 1
for the degenerate nests in the RUM model otherwise you will not get convergence. I do not believe the IV parameters exist for the RUM
model in this case. They are identifiable in the Nonnormalized model
if you have an alternative specific variable (maybe var1 in your model
specification).

Best Regards

-Rich
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index