Statalist The Stata Listserver


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

st: Creating loops to drop observations each time regression is run


From   Samia Tavares <[email protected]>
To   [email protected]
Subject   st: Creating loops to drop observations each time regression is run
Date   Sat, 1 Apr 2006 10:28:59 -0500

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/




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