{smcl}
{hline}
help for {hi:espoisson} {right:(SJ4-1: st0057)}
{hline}

{title:FIML endogenous switching Poisson model}

{p 8 13 2}{cmd:espoisson}{space 2}{it:depvar} [{it:varlist}] 
	[{cmd:if} {it:exp}] [{cmd:in} {it:range}] {cmd:,}
	{cmdab:ed:ummy(}{it:varname}{cmd:)} [ {cmdab:s:witch(}{it:varlist}{cmd:)}
        {cmdab:q:uadrature(}{it:#}{cmd:)} {cmd:rho0(}{it:#}{cmd:)} 
	{cmd:sigma0(}{it:#}{cmd:)} {cmd:exs} {it:maximize_options}]

{p 8 8 2}Note: the vector {it:varlist} should include the switch variable
(endogenous dummy) as one of its elements.{p_end}

{p 4 4 2} The syntax of {help predict} after {cmd:espoisson} is

{p 8 16 2}{cmd:predict} {it:newvar} [{cmd:if} {it:exp}]
	[{cmd:in} {it:range}] [{cmd:,} n ]

{p 4 4 2}where,

{p 8 21 2}{cmd:n}{space 9}predicted number of events (default){p_end}
	

{title:Description}

{p 4 4 2}{cmd:espoisson} fits a FIML endogenous switching Poisson model.
An endogenous dummy variable is present in the vector of explanatory
variables, and there is unobserved individual heterogeneity. The endogenous
dummy variable indicates the realization of two different regimes. The
endogenous switching model corrects for the  simultaneous equation bias that
the presence of the endogenous dummy may induce in a standard exogenous-switch
count model. 

{p 4 4 2}This program uses {cmd:ml d0} method. 


{title:Options}

{p 4 8 2}{cmd:edummy(}{it:varname}{cmd:)} (required) specifies the endogenous
dummy variable.

{p 4 8 2} {cmd:switch(}{it:varlist}{cmd:)} specifies explanatory variables for
the index function governing the endogenous dummy. If {cmd:switch()} is
unspecified then a constant-only model is fitted.

{p 4 8 2}{cmd:quadrature(}{it:#}{cmd:)} specifies the number of quadrature
points for the Gauss-Hermite integral. Six points are used by default.

{p 4 8 2}{cmd:rho0(}{it:#}{cmd:)} specifies initial value for rho. If
unspecified, {cmd:rho0()}=0.01.

{p 4 8 2}{cmdab:sigma0(}{it:#}{cmdab:)} specifies initial value for sigma. If
unspecified, {cmd:sigma0()}=1.0.

{p 4 8 2}{cmdab:exs} causes the program to fit an exogenous switching
model.


{title:Examples}

{p 8 12 2}{cmd:. espoisson  y x1 x2, ed(x2) s(x1) q(16)}{p_end}
{p 8 12 2}{cmd:. predict yhat, n}{p_end}

{p 8 12 2}{cmd:. espoisson  y x1 x2, ed(x2) s(x1) q(16) exs}{p_end}
{p 8 12 2}{cmd:. predict yhat, n}{p_end}


{title:Author}

{p 4 8 2}{bf: Alfonso Miranda}{p_end}
{p 4 8 2} Economics Department, Warwick University, CV4 7AL, UK.{p_end}
{p 4 8 2}E-mail: Alfonso.Miranda-Caso-Luengo@warwick.ac.uk{p_end}


{title:Also see}

{p 4 14 2}Manual:  {hi:[U] 23 Estimation and post-estimation commands},{p_end}
{p 13 13 2}{hi:[U] 29 Overview of model estimation in Stata},{p_end}
{p 13 13 2}{hi:[R] poisson}
{p 4 13 2}Online:  help for {help ml}, {help glm}, {help nbreg}, {help svypois},
{help xtpois}, {help zip}
