Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# RE: st: RE: How do I execute the "intreg" command succcessfully?

 From "Alam, Sartaj" To "statalist@hsphsun2.harvard.edu" Subject RE: st: RE: How do I execute the "intreg" command succcessfully? Date Wed, 17 Feb 2010 20:29:29 -0600

```Hay Richard, if you have the single income variable then you can create these two variables and run the intreg there after. Consider the following simple code to give you an idea:
In this case the income variable is categorical once (i.e. HHINC_EV=2 for household income from 10,000 to 15,000)

gen IncomeLow=.
gen IncomeHi=.
replace IncomeHi=10000 if HHINC_EV==1
replace IncomeLow=10000 if HHINC_EV==2
replace IncomeHi=15000 if HHINC_EV==2
replace IncomeLow=15000 if HHINC_EV==3
replace IncomeHi=25000 if HHINC_EV==3
replace IncomeLow=25000 if HHINC_EV==4
replace IncomeHi=35000 if HHINC_EV==4
replace IncomeLow=35000 if HHINC_EV==5
replace IncomeHi=50000 if HHINC_EV==5
replace IncomeLow=50000 if HHINC_EV==6
replace IncomeHi=75000 if HHINC_EV==6
replace IncomeLow=75000 if HHINC_EV==7
replace IncomeHi=100000 if HHINC_EV==7
replace IncomeLow=100000 if HHINC_EV==8
replace IncomeHi=150000 if HHINC_EV==8
replace IncomeLow=150000 if HHINC_EV==9
replace IncomeHi=200000 if HHINC_EV==9
replace IncomeLow=200000 if HHINC_EV==10
tab HHINC_EV  IncomeLow
tab   IncomeLow  IncomeHi
tab HHINC_EV
svy: intreg  IncomeLow IncomeHi  ....covariates (independent variable list)

Sartaj Alam

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Richard Williams
Sent: Wednesday, February 17, 2010 5:54 PM
To: statalist@hsphsun2.harvard.edu; statalist@hsphsun2.harvard.edu
Subject: Re: st: RE: How do I execute the "intreg" command succcessfully?

At 06:17 PM 2/17/2010, Martin Weiss wrote:

><>
>
>The lower and upper bound must be part of your dataset for -intreg- to be
>useful, just as you can see from the example at the bottom of -help intreg-.
>
>***
>webuse intregxmpl, clear
>intreg wage1 wage2 age c.age#c.age nev_mar rural school tenure
>***
>
>Here, "wage1" and "wage2" are variables in the dataset, no need to create
>them.

I think that is his problem though -- it looks like, in all of the
examples Martin Ryan listed, the upper and lower bound variables were
already part of the data set.  He wants to know how to create those
vars in the first place.  My last couple of posts provide examples of that.

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```