{smcl}
{hline}
help for {hi:hnbreg1} {right:(Joseph Hilbe)}
{hline}

{title:Heterogeneous linear negative binomial regression (NB-1)}

{p 8 13 2}{cmd:hnbreg1}{space 2}{it:depvar} [{it:varlist}] 
	[{cmd:if} {it:exp}] [{cmd:in} {it:range}]  [, {cmdab:lnd:elta(}{it:varlist}{cmd:)}
         {cmdab:off:set(}{it:varname}{cmd:)} {cmdab:exp:osure(}{it:varname}{cmd:)} 
         {cmdab:cl:uster(}{it:varname}{cmd:)} {cmdab:l:evel(}{it:#}{cmd:)} 
         {cmdab:from:(}{it:asis}{cmd:)} {cmdab:ir:r} {cmdab:eform} {cmdab:rob:ust}
         {cmd:nolog} {it:maximize_options} {it:survey_options}]


{p 4 4 2}
{cmd:aweight}s, {cmd:fweight}s, {cmd:iweight}s, and {cmd:pweight}s are
allowed; see help {help weights}.

{p 4 4 2}
{cmd:hnbreg1} provides access to all {it:maximize} options; see help {help maximize}.

{p 4 4 2}
{cmd:hnbreg1} provides access to all {it:survey} options; see help {help svy}.


{title:Description}

{p 4 4 2}{cmd:hnbreg1} fits a maximum-likelihood linear negative binomial regression 
model (NB-1), with a heterogeneous (Stata: -generalized-) parameterization of {it:depvar} 
on {it:indepvars}, where {it:depvar} is a non-negative count variable.

{p 4 4 2}{cmd:hnbreg1} acccepts all of the {it:help maximize} options, the {it:constraint()} 
option, and all survey options and capabilities documented in {cmd:[SVY]}; including 
multi-level surveys; poststratification; and BRR, jackknife, and linearization VCE estimators.

{p 4 4 2}The {cmd:lndelta}() option parameterizes the natural log of delta, the linear negative 
binomial heterogeneity or ancillary parameter. When parameterized, the displayed value of 
delta is the exponential of the parameterized constant, and has little value for understanding
predictor contributions to the parameter. 

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


{title:Options}

{dlgtab:Model}

{phang}
{opth lndelta(varlist)} in which ancillary parameter delta is parameterized by listed variables. 

{phang}
{opth offset(varname)} specifies a {it:varname} in model with coefficient constrained to 1.

{phang}
{opth exposure(varname)} specifies a {it:ln(varname)} in model with coefficient constrained to 1.

{phang}
{opth constraints(constraints)} apply specified linear constraints.



{dlgtab:SE/Robust}

{phang}
{opth cluster(varname)} 

{p 4 8 2}
{cmd:robust} specifies that the Huber/White/sandwich estimator of
variance is to be used in place of the traditional calculation.  {cmd:robust}
combined with {cmd:cluster}{cmd:(}{cmd:)} allows observations which are not
independent within cluster (although they must be independent between
clusters).  If you specify {cmd:pweight}s, {cmd:robust} is implied.

{phang}
{opth vce(options)} allowed. {cmd:vce}{cmd:(}{cmd:)} supports {it:robust}, {it:opg}, and {it:native}.
{cmd:vce} does not support options {it:bootstrap} or {it:jacknife}, However,  {cmd:hnbreg1} supports  
the {cmd:bootstrap} and {cmd:jacknife} commands.  


{dlgtab:Reporting}
   
{p 4 8 2}{cmd:level(}{it:#}{cmd:)} specifies the confidence level, in percent,
for confidence intervals of the coefficients; see help {help level}.

{p 4 8 2}
{cmd:nolog} suppresses the iteration log.

{p 4 8 2}
A likelihood ratio test is provided between {cmd:hnbreg1} with delta=0 and the estimated model.
{cmd:hnbreg1} with delta=0 is a {cmd:poisson} model. 


{dlgtab:max options}

{phang}

{p 4 8 2}
{it:maximize_options}: technique(algorithm_spec), [no]log, trace, hessian, gradient, showstep, 
shownrtolerance, difficult, iterate(#), tolerance(#), ltolerance(#), gtolerance(#), nrtolerance(#), 
nonrtolerance, from(init_specs); see {help maximize}.  


{dlgtab:svy options}

{phang}
{it:survey_options} are all available. See help {help svy}




{title:Author and support}

{phang}
{cmd: Joseph Hilbe},
{cmd: Arizona State University}:
{cmd: Hilbe@asu.edu}


{title:Remarks}

{pstd}
{cmd:hnbreg1} is a user authored program. Support is by author. 
{cmd:NOTE}: The heterogeneous linear negative binomial is similar to Stata's {help gnbreg}
command, except that it provides for the parameterization of the negative binomial 
heterogeneity parameter when the dispersion is specified as constant. 

{pstd}
{cmd:hnbreg1} requires a nonnegative response.


{title:Examples}

{phang}{cmd:. hnbreg1 los hmo white type2 type3, nolog irr}

{phang}{cmd:. hnbreg1 los hmo white type2 type3, nolog  lndelta(hmo white)}

{phang}{cmd:. hnbreg1 los hmo white type2 type3, nolog exposure(pop) cluster(state)}

{phang}{cmd:. bootstrap: hnbreg1 los hmo white type2 type3, nolog lndelta(hmo white) eform}


{title:Reference}

{phang}
Hilbe, J. (2007), {it:Negative Binomial Regression}, Cambridge, UK: Cambridge University Press.

{phang}
Hardin, J. & J. Hilbe (2007), {it:Generalized Linear Models and Extensions}, 2nd ed., Stata Press.


{title:Also see}

{psee}
Online:  {helpb help} {helpb gnbreg} {helpb nbreg}




