{smcl}
{* 16oct2001}{...}
{hline}
help for {hi:intreg2} {right:(manual:  {hi:[R] tobit})}
{hline}

{title:interval regression with heteroskedasticity}

{p 4 12}{cmd:intreg}{space 2}{it:depvar1} {it:depvar2} [{it:indepvars}]
[{it:weight}] [{cmd:if} {it:exp}] [{cmd:in} {it:range}]
[{cmd:,} {cmdab:h:et(}{it:varlist}{cmd:)}
{cmdab:nocon:stant} {cmdab:r:obust}
{cmdab:cl:uster(}{it:varname}{cmd:)}
{cmdab:sc:ore(}{it:newvar1} {it:newvar2}{cmd:)}
{cmdab:l:evel(}{it:#}{cmd:)} {cmdab:const:raints(}{it:numlist}{cmd:)} 
{cmdab:nolo:g} {it:maximize_options}]

{p}{cmd:by} {it:...} {cmd::} may be used with these commands; see help
{help by}.

{p}{cmd:aweight}s, {cmd:fweight}s, {cmd:pweight}s  and {cmd:iweight}s
are allowed.

{p}These commands share the features of all estimation commands; see help
{help est}.


{p}The syntax of {help predict} following {cmd:intreg2} is

{p 8 16}{cmd:predict} [{it:type}] {it:newvarname} [{cmd:if} {it:exp}]
[{cmd:in} {it:range}] [{cmd:,} {it:statistic}]

{p}where {it:statistic} is

{p 8 29}{cmd:xb} {space 13} fitted values; the default{p_end}
{p 8 29}{cmdab:p:r}{cmd:(}{it:a}{cmd:,}{it:b}{cmd:)} {space 8} 
        Pr({it:a}<y<{it:b}){p_end}
{p 8 29}{cmd:e}{cmd:(}{it:a}{cmd:,}{it:b}{cmd:)} {space 9} 
        E(y | {it:a}<y<{it:b}){p_end}
{p 8 29}{cmdab:ys:tar}{cmd:(}{it:a}{cmd:,}{it:b}{cmd:)} {space 5} 
        E(y*), y* = max({it:a},min(y,{it:b})){p_end}
{p 8 29}{cmd:stdp} {space 11} standard error of the prediction{p_end}
{p 8 29}{cmd:stdf} {space 11} standard error of the forecast{p_end}

{p}where {it:a} and {it:b} may be numbers or variables; {it:a} equal to
`{hi:.}' means -infinity; {it:b} equal to `{hi:.}' means infinity.

{p}These statistics are available both in and out of sample; type
"{cmd:predict} {it:...} {cmd:if e(sample)} {it:...}" if wanted only for the
estimation sample.


{title:Description}

{p}{cmd:intreg2} estimates a model of {it:y}=[{it:depvar1},{it:depvar2}] on
{it:indepvars}, where {it:y} for each observation is either point data,
interval data, left-censored data, or right-censored data.  {it:depvar1} and
{it:depvar2} should have the following form:

{center:Type of data {space 16} {it:depvar1}  {it:depvar2}}
{center:{hline 46}}
{center:point data       {it:a} = [{it:a},{it:a}]       {it:a}        {it:a}    }
{center:interval data        [{it:a},{it:b}]       {it:a}        {it:b}    }
{center:left-censored data   (-inf,{it:b}]    {cmd:.}        {it:b}    }
{center:right-censored data  [{it:a},inf)     {it:a}        {cmd:.}    }
{center:{hline 46}}

{p}{cmd:intreg2} is an expansion of {cmd:intreg} to include the specification
of the conditional variance. Instead of 
(beta/sigma, 1/sigma) parameter space in {cmd:intreg}, {cmd:intreg2} uses 
(beta, ln(sigma)) to estimate the maximum log-likelihood. The 
heteroskedasticity is modeled as: sigma=exp(z*delta), where z is the vector 
of variables denoting heteroskedasticity. 

{title:Options}

{p 0 4}{cmd:het(}{it:varlist}{cmd:)} specifies {it:varlist} which denotes
the variables for heteroskedasticity.

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

{p 0 4}{cmd:noconstant} suppresses the constant term
(intercept) in the estimation.

{p 0 4}{cmd:robust} specifies that the
Huber/White/sandwich estimator of variance is to be used in place of the
conventional MLE variance estimator.  {cmd:robust} combined with
{cmd:cluster()} further allows observations which are not independent within
cluster (although they must be independent between clusters).

{p 4 4}If you specify {cmd:pweight}s, {cmd:robust} is implied.  See
{hi:[U] 23.11 Obtaining robust variance estimates}.

{p 0 4}{cmd:cluster(}{it:varname}{cmd:)}  specifies that
the observations are independent across groups (clusters) but not necessarily
independent within groups.  {it:varname} specifies to which group each
observation belongs.  {cmd:cluster()} can be used with {help pweight}s to
produce estimates for unstratified cluster-sampled data.

{p 4 4}{cmd:cluster()} implies {cmd:robust}; that is, specifying
{cmd:robust cluster()} is equivalent to typing {cmd:cluster()} by itself.

{p 0 4}{cmd:score(}{it:newvar1 newvar2}{cmd:)} creates two
new variables containing the contributions to the scores; see {hi:[R] tobit}
and {hi:[U] 23.12 Obtaining scores}.

{p 0 4}{cmd:constraints(}{it:numlist}{cmd:)} specifies the
linear constraints to be applied during estimation.  Constraints are defined
using the {cmd:constraint} command and are numbered; see help
{help constraint}.  The default is to perform unconstrained estimation.

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

{p 0 4}{it:maximize_options} control the maximization process; see help
{help maximize}.  You should never have to specify them.  


{title:Options for {help predict}}

{p 0 4}{cmd:xb}, the default, calculates the fitted values.

{p 0 4}{cmd:pr(}{it:a}{cmd:,}{it:b}{cmd:)} calculates the
Pr({it:a} < xb+u < {it:b}), the probability that y|x would be observed in the
interval ({it:a},{it:b}).

{p 4 4}{it:a} and {it:b} may be specified as numbers or variable names;
{cmd:pr(20,30)} calculates Pr(20 < xb+u < 30); {cmd:pr(lb,ub)} calculates
Pr(lb < xb+u < ub); and {cmd:pr(20,ub)} calculates Pr(20 < xb+u < ub).

{p 4 4}{it:a}==. means minus infinity; {cmd:pr(.,30)} calculates Pr(xb+u < 30)
and {cmd:pr(lb,30)} calculates Pr(xb+u < 30) in observations for which lb==.
(and calculates Pr(lb < xb+u < 30) elsewhere).

{p 4 4}{it:b}==. means plus infinity; {cmd:pr(20,.)} calculates Pr(xb+u > 20)
and {cmd:pr(20,ub)} calculates Pr(xb+u > 20) in observations for which ub==.
(and calculates Pr(20 < xb+u < ub) elsewhere).

{p 0 4}{cmd:e(}{it:a}{cmd:,}{it:b}{cmd:)} calculates
E(xb+u | {it:a} < xb+u < {it:b}), the expected value of y|x conditional on y|x
being in the interval ({it:a},{it:b}), which is to say, y|x is censored.
{it:a} and {it:b} are specified as they are for {cmd:pr()}.

{p 0 4}{cmd:ystar(}{it:a}{cmd:,}{it:b}{cmd:)} calculates E(Y*), where
Y* = {it:a} if xb+u <= {it:a}, Y* = {it:b} if xb+u >= {it:b}, and Y* = xb+u
otherwise, which is to say, Y* is truncated.  {it:a} and {it:b} are specified
as they are for {cmd:pr()}.

{p 0 4}{cmd:stdp} calculates the standard error of the prediction.

{p 0 4}{cmd:stdf} calculates the standard error of the forecast.

{title:Examples: }

{p}Assume a dataset contains income, truncated and in categories.  Some of the
observations on income are

	   y1       y2
{p 9 27}20000{space 4}24000 {space 2} meaning  20000 <= income <= 24000{p_end}
{p 8 27}100000{space 6}. {space 4} meaning 100000 <= income

{p}Variable z specifies the conditional variance. The command to estimate 
with these data is

{p 8 12}{inp:. intreg2 y1 y2 x1 x2 x3 x4, het(z)}


{title:Also see}

{p 1 14}Manual:  {hi:[U] 23 Estimation and post-estimation commands},{p_end}
{p 10 14}{hi:[U] 29 Overview of model estimation in Stata},{p_end}
	  {hi:[R] tobit}
{p 0 19}On-line:  help for {help constraint}, {help est},
{help postest}; {help heckman}, {help oprobit}, {help regress},
{help svyintreg}, {help tobit}, {help xtintreg}, {help xttobit}{p_end}
