[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: dropping one unit at a time

From   "Eric A. Booth" <>
Subject   Re: st: dropping one unit at a time
Date   Wed, 17 Jun 2009 21:39:23 -0500


Assuming your countries are identified by some sequential id number, say 1 to 250, you could run something like:


//full model
regress dv x1 x2
	outreg2 using "test.xls", replace

//models with one country dropped
foreach n of numlist 1/250 {
	regress dv x1 x2 if countryID !=`n'
	outreg2 using "test.xls", append


Keep in mind that its going to keep appending models to the right of the full model until all units have been dropped you may want to cut down the number being dropped if you have some other decision criteria, or break up the table created in the loop into multiple files.

~ Eric

Eric A. Booth
Public Policy Research Institute
Texas A&M University
Office: +979.845.6754

On Jun 17, 2009, at 9:14 PM, Carola Herrera wrote:

Dear Statalist participants,

I wish to examine whether my OLS results are driven by any particular country in my panel dataset. What is the Stata code to drop one country at the time and re-run the regression? Is there a better way to test for this?


*   For searches and help try:

*   For searches and help try:

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