Inrange/Inlist
Can be used with dates. Say you want to restrict your dataset to beneficiaries who were discharges between Jan 1, 2007 and Sep 30, 2007.
keep if inrange(dschrgdt,date("01/01/2007","MDY"),date("09/30/2007","MDY"))

seen from India
seen from United States

seen from India

seen from Germany

seen from United States

seen from Australia
seen from Türkiye
seen from Algeria
seen from Brazil
seen from France

seen from Brazil
seen from Germany
seen from United States

seen from United States
seen from United States
seen from United States
seen from Germany
seen from China
seen from Australia

seen from Türkiye
Inrange/Inlist
Can be used with dates. Say you want to restrict your dataset to beneficiaries who were discharges between Jan 1, 2007 and Sep 30, 2007.
keep if inrange(dschrgdt,date("01/01/2007","MDY"),date("09/30/2007","MDY"))

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Identifying Unique Observations
Context: multi-level data. For example, you have a patient-level dataset but want to know how many hospitals performed a certain kind of operation by volume quintile.
The easier method is to:
ssc inst unique /* downloads unique command */ cap drop temp_hospvols /* drop this variable prior to generation */ unique hospid4merge, by(op_1 cat5hospvol) gen(temp_hospvol) drop temp_hospvols
Alternatives include running codebook with different levels of restrictions in a loop.
forval op = 500(100)(700){ forval vq = 1/5{ codebook hospid4merge if op_1 == `op' & cat5hospvol == `vq' } // closes volume quintile loop } // closes operative code loop
For more information see also http://bit.ly/1fl6MJs
STATA cmd of the day: "set trace on"
"set trace on" shows you all the background code (in significant detail). At a low level (me) this is mostly useful if you need to figure out where you went wrong in a complicated series of loops. Â Without using this command you often have to start at the beginning, take out individual blocks of code from your loop and test-run them to diagnose the issue. Â TRACE at least puts you in the right ball park most of the time.