Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Predict Command after zinb

From   "Yulia Marchenko" <>
To   <>
Subject   st: RE: Predict Command after zinb
Date   Fri, 11 Mar 2005 11:29:36 -0600

Anju wrote:

>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

The formula for the expected number of counts (-predict- with -n- option) is
the following:


Here is an example of how you can get the expected number of counts using
the formula:

/****begin do file****/
webuse fish, clear
zinb count persons livebait, inf(child camper) nolog
matrix b=e(b)
/****predict number of counts adjusted for probability of non-zero
predict double cnt, n
/****predict probability of zero count****/
predict double p, p
/****corresponding formula for the prediction of number of events****/
gen double cntform=(1-p)*exp(b[1,1]*persons+b[1,2]*livebait+b[1,3])
summ count cntform
assert cnt==cntform
/****end do file******/


*   For searches and help try:

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