Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: predict, condpb


From   Richard Williams <[email protected]>
To   [email protected], statalist <[email protected]>
Subject   Re: st: predict, condpb
Date   Tue, 06 Aug 2013 11:53:32 -0500

Glad to hear it. You can get help for Stata 13 commands online, e.g.

http://www.stata.com/help.cgi?nlogit

One of my wishlist items would be to keep the help available for older versions of Stata as well. (Or maybe there is something like that?)

You can also wade through the whatsnew files. If you type

help whatsnew9to10

You find

"Existing estimation command nlogit was rewritten and has new, better syntax and runs faster when there are more than two levels. Old syntax is available under version control. nlogit now fits the random utilities maximization (RUM) model by default as well as the nonnormalized model that was available previously. The new nlogit now allows unbalanced groups and allows groups to have different sets of alternatives. nlogit now excludes entire choice sets (cases) if any alternative (observation) has a missing value; use new option altwise to exclude just the alternatives (observations) with missing values. Finally, vce(robust) is allowed regardless of the number of nesting levels. See [R] nlogit."

Given that is sounds like there were a lot of improvements to nlogit, it may be to your advantage to figure out what the new and improved syntax is, at least if you want to do new analysis as opposed to just replicating old results. I would probably try to replicate old results using the new syntax (to make sure I was doing it right) and then go from there.


At 10:24 AM 8/6/2013, Stefan Bernhard wrote:
Richard, that was it!

Actually, there was another nlogit that I put under comment stars some
days ago because it would not run due to some syntax error. However,
obviously that one was written for Stata 9... I tried using that with
-version- and

version 9: nlogit ...
version 9: preditct x1, condpb

worked in the end.

thank you, stefan bernhard,

2013/8/6 Richard Williams <[email protected]>:
> Actually, I just checked my old copy of Stata 9.2, and condpb and pb were
> legitimate options for it (but apparently disappeared by Stata 10). So I
> think Nick had the right idea before but the version command was in the
> wrong place. Try something like
>
> version 9.2
> nlogit [whatever]
>
> predict x1, condpb
> predict x2, pb
>
> This underscores why it is a good idea to include version commands in your
> do files. If you don't, the command may not run correctly under future
> versions of Stata. Even in this case, it is possible that you should be
> using something earlier than 9.2.
>
> Alternatively, you could figure out exactly what each of these options did
> and then use whatever the current options are.
>
>
> At 09:20 AM 8/6/2013, Stefan Bernhard wrote:
>>
>> Thanks Nick and Richard (your example works fine), I did not know that
>> predict was specific to the previous estimation command. There's
>> something new to learn about stata every day...
>> Therefore the question is resolved.
>>
>> Well then the problem clearly is that in the do-file that I was given,
>> there is no nlogitrum at all, which is strange because why would there
>> be that specific predict for nlogitrum then...
>>
>> best, stefan bernhard,
>>
>> 2013/8/6 Richard Williams <[email protected]>:
>> > Works for me. travelmode is an auxiliary file that you can download
>> > along
>> > with the program:
>> >
>> > use "C:\StataData\travelmode.dta", clear
>> > nlogitrum mode asc_* hinc_* time_*, group(grp) nests(travel type)
>> >
>> > predict x1, condpb
>> > predict x2, pb
>> >
>> > Like Nick says we need to see the code. In particular, you have to run
>> > nlogitrum first before you run the predict commands. predict options are
>> > often specific to the estimation command that has just been run; they
>> > aren't
>> > going to work after every estimation command.
>> >
>> >
>> > At 08:37 AM 8/6/2013, Nick Cox wrote:
>> >>
>> >> I think you might need to tell us much more about your do-file and
>> >> what it runs immediately before it invokes -predict-.
>> >>
>> >> Earlier I was following your guess that something is no longer allowed
>> >> in newer versions of Stata (Stata 12 in your case) but on further
>> >> thought that's unlikely to be the problem.
>> >>
>> >> The key point here is that -predict- in itself does nothing much
>> >> except call up whatever prediction program is associated with the last
>> >> estimation command.
>> >>
>> >> It sounds as if you might need something user-written to be installed,
>> >> specifically                  -nlogitrum_p-, although the error
>> >> message remains a puzzle to me.
>> >> Nick
>> >> [email protected]
>> >>
>> >>
>> >> On 6 August 2013 14:16, Stefan Bernhard <[email protected]>
>> >> wrote:
>> >> > Yeah I did that because I thought maybe it does some alterations to
>> >> > -predict-, but that is not the case, still not allowed option :/
>> >> > best stefan bernhard,
>> >> >
>> >> > 2013/8/6 Kieran McCaul <[email protected]>:
>> >> >> ...
>> >> >>
>> >> >>
>> >> >> Looks like you have to download -nlogitrum-
>> >> >>
>> >> >> Type: search nlogitrum
>> >> >> And click on the link.
>> >> >>
>> >> >> -----Original Message-----
>> >> >> From: [email protected]
>> >> >> [mailto:[email protected]] On Behalf Of Stefan
>> >> >> Bernhard
>> >> >> Sent: Tuesday, 6 August 2013 8:00 PM
>> >> >> To: statalist
>> >> >> Subject: Re: st: predict, condpb
>> >> >>
>> >> >> Thanks for the reply nick,
>> >> >>
>> >> >> but I tried all version #: from 1 to 11 now and always the error
>> >> >> "option condpb not allowed".
>> >> >>
>> >> >> I found a stata-journal article from 2002 where the syntax of
>> >> >> predict
>> >> >> looks like this:
>> >> >>
>> >> >> predict  type newvarname  if exp  in range  , statistic
>> >> >>
>> >> >> Where the condpb and pb were set with statistic.
>> >> >>
>> >> >> http://www.stata-journal.com/sjpdf.html?articlenum=st0017
>> >> >>
>> >> >> It seems like that was for Stata 7 and the predict command has
>> >> >> undergone significant changes sometime in between. Or could it have
>> >> >> to do
>> >> >> anything with having to run nlogitrum first? (In the do-file, the
>> >> >> predict is
>> >> >> after an nlogit)
>> >> >>
>> >> >> best, stefan bernhard,
>> >> >>
>> >> >> 2013/8/6 Nick Cox <[email protected]>:
>> >> >>> Try a prefix such as
>> >> >>>
>> >> >>> version 5: predict x1, condpb
>> >> >>>
>> >> >>> for any value of "5" that works.
>> >> >>>
>> >> >>> See also the -help- for -version-.
>> >> >>>
>> >> >>> Nick
>> >> >>> [email protected]
>> >> >>>
>> >> >>>
>> >> >>> On 6 August 2013 12:08, Stefan Bernhard
>> >> >>> <[email protected]>
>> >> >>> wrote:
>> >> >>>> dear statalisters,
>> >> >>>>
>> >> >>>> i have a do file that was written some time ago that contains
>> >> >>>>
>> >> >>>> predict x1, condpb
>> >> >>>> predict x2, pb
>> >> >>>>
>> >> >>>> apparently, the options condpb and pb are no longer allowed in
>> >> >>>> newer
>> >> >>>> versions of stata (I use stata 12).
>> >> >>>>
>> >> >>>> Is there any way to do whatever those options did before (I just
>> >> >>>> want
>> >> >>>> to replace these commands with something that gives me the same
>> >> >>>> output as those would have in an older version of stata)?
>> >> >>>>
>> >> >>>> best, stefan bernhard,
>> >> >>>> *
>> >> >>>> *   For searches and help try:
>> >> >>>> *   http://www.stata.com/help.cgi?search
>> >> >>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> >> >>>> *   http://www.ats.ucla.edu/stat/stata/
>> >> >>> *
>> >> >>> *   For searches and help try:
>> >> >>> *   http://www.stata.com/help.cgi?search
>> >> >>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> >> >>> *   http://www.ats.ucla.edu/stat/stata/
>> >> >> *
>> >> >> *   For searches and help try:
>> >> >> *   http://www.stata.com/help.cgi?search
>> >> >> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> >> >> *   http://www.ats.ucla.edu/stat/stata/
>> >> >>
>> >> >> *
>> >> >> *   For searches and help try:
>> >> >> *   http://www.stata.com/help.cgi?search
>> >> >> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> >> >> *   http://www.ats.ucla.edu/stat/stata/
>> >> > *
>> >> > *   For searches and help try:
>> >> > *   http://www.stata.com/help.cgi?search
>> >> > *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> >> > *   http://www.ats.ucla.edu/stat/stata/
>> >> *
>> >> *   For searches and help try:
>> >> *   http://www.stata.com/help.cgi?search
>> >> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> >> *   http://www.ats.ucla.edu/stat/stata/
>> >
>> >
>> > -------------------------------------------
>> > Richard Williams, Notre Dame Dept of Sociology
>> > OFFICE: (574)631-6668, (574)631-6463
>> > HOME:   (574)289-5227
>> > EMAIL:  [email protected]
>> > WWW:    http://www.nd.edu/~rwilliam
>> >
>> >
>> > *
>> > *   For searches and help try:
>> > *   http://www.stata.com/help.cgi?search
>> > *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> > *   http://www.ats.ucla.edu/stat/stata/
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>
>
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> HOME:   (574)289-5227
> EMAIL:  [email protected]
> WWW:    http://www.nd.edu/~rwilliam
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index