Statalist The Stata Listserver

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

Re: st: RE: Zero Trunctated and One inflated Poisson

From   Giorgio Ricchiuti <>
Subject   Re: st: RE: Zero Trunctated and One inflated Poisson
Date   Tue, 20 Mar 2007 08:12:56 +0100

Thanks a lot for your reply. If I got the point are you suggesting me to write a program as follows?

version 8
args lnf mu teta
quietly replace ‘lnf’ = exp(-`teta') if $ML_y1==1
quietly replace ‘lnf’ = ln(1-exp(-`teta'))+ $ML y1*ln(`mu')- `mu' - lnfact($ML y1)- ln(1-exp(-`mu')) if $ML_y1>1

. ml model lf myoneinflated (y = x1 x2 x3) () () () ()
. ml init tau1=1 tau2=2 tau3=3 tau4=4, skip
. ml check
. ml maximize


Maarten Buis wrote:

--- Giorgio Ricchiuti wrote:
I have been modelling the number of affiliates that the firm i has in
the country j. My data are zero-truncated but unfortunately are even
one-inflated (75% of cases). I did not find any possibility to analyse
this mix-model in STATA 9.0 (neither using for example zip or ztp). I
worked out the maximum likelihood, and I changed the adofile of zip as

Of course I also changed gradient and hessian but, unfortunately, I am
not a developer, hence I did some mistake.

Does anyone help me, explaining either how to change the maximum
likelihood correctly or developing the model directly in Stata?
Most user written ml commands use lf instead of d2 because lf is much easier to program. You can use my ``zero inflated logit'' program I sent to the statalist this morning as a template: .

Hope this helps,

*   For searches and help try:

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