Statalist


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

st: RE: program for similiar commands


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: program for similiar commands
Date   Wed, 11 Jun 2008 10:00:07 +0200

Here is a shot at the problem:

********
loc j=1100

forv i=1/9{
	g child0`i'_HH=1
	replace  child`i'_HH=0 if T0991`j'~=1
	loc j `=`j'+500'
}

loc j=5400

forv i=10/11{
	g child0`i'_HH=1
	replace  child`i'_HH=0 if T0991`j'~=1
	loc j `=`j'+500'
}
********

Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Man Jia
Sent: Wednesday, June 11, 2008 7:34 AM
To: [email protected]
Subject: st: program for similiar commands

Hi all,

I was wondering if anyone could give me some hint of how to simply the 
following commands:

---------------------------------------------
gen child01_HH=1
replace  child01_HH=0 if T0991100~=1
gen child02_HH=1
replace  child02_HH=0 if T0991600~=1
gen child03_HH=1
replace  child03_HH=0 if T0992100~=1
gen child04_HH=1
replace  child04_HH=0 if T0992600~=1
gen child05_HH=1
replace  child05_HH=0 if T0993100~=1
gen child06_HH=1
replace  child06_HH=0 if T0993600~=1
gen child07_HH=1
replace  child07_HH=0 if T0994100~=1
gen child08_HH=1
replace  child08_HH=0 if T0994600~=1
gen child09_HH=1
replace  child09_HH=0 if T0995000~=1
gen child10_HH=1
replace  child10_HH=0 if T0995400~=1
gen child11_HH=1
replace  child11_HH=0 if T0995800~=1
------------------------------------------
Thanks!

Man Jia
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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