Thanks May and Yulia.
It works:)
Regards
Anju
--- May Boggess <[email protected]> wrote:
> On Friday, Anju asked:
> >
> > I am trying to understand how the predict command
> > works after zinb command. I want to know if we can
> use
> > generate command to get the same result as predict
> > command.
> >
>
> Here is an example that shows what -predict- can do
> after -zinb-:
>
> clear
> webuse fish
> drop xb
> zinb count persons livebait, inf(child camper)
> nolog
> predict xb1,xb
> gen myxb1=[count]_b[persons]*persons /*
> */ +[count]_b[livebait]*livebait+[count]_b[_cons]
> sum xb1 myxb1
>
> predict xb2,xb equation(#2)
> gen myxb2=[inflate]_b[child]*child /*
> */ +[inflate]_b[camper]*camper+ [inflate]_b[_cons]
> sum xb2 myxb2
>
> predict p,p
> gen myp=exp(xb2)/(1+exp(xb2))
> sum p myp
>
> predict n, n
> gen myn=(1-p)*exp(xb1)
> sum n myn
>
> My technique for finding out what -predict- is up to
> behinds the scenes
> is to use -set trace on-. Now, a lot of times -set
> trace on- produces
> too much output to search through, but I have found
> that for the
> purposes of finding a -predict- formula, there is
> surprisingly little
> output. Then one can look back through the trace to
> find the generate
> statements that -predict- actually used.
>
> By the way, a nice feature of -set trace on- that I
> have used, is the
> highlight. It highlights a specific word in the
> output making it easier
> to find what you are looking for. Type
>
> whelp trace
>
> to see the help file for that.
>
> -- May
> [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/
>
____________________________________________________________
Anju Parthan,
Doctoral Candidate,
The University of Texas at Austin, PHAR-PHARMACY ADMIN
1 UNIVERSITY STATION A 1930, AUSTIN, TX-78712
Tel: (512) 459-4942; Fax: (512) 471-8762
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
*
* 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/