You can use the 'foreach'. See help on 'foreach' for details.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Samia Tavares
Sent: Saturday, April 01, 2006 10:29 AM
To: [email protected]
Subject: st: Creating loops to drop observations each time regression is run
Hi everyone!
I have a panel consisting of different countries for a number of years. I am
trying to write a program that would tell Stata to run a regression while
each time dropping a particular country (in other words, all the years for
which that country has observations). All I have so far is the manual
version:
use dataset.dta, clear
drop if code=="country1"
regress y x
use dataset.dta, clear
drop if code=="country2"
regress y x
and so forth. I am clueless as to how to write programs, so any help will be
immensely appreciated!!
Samia
*
* 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/