Dear Shehzad,
I am aware of two options to do this:
1. Reload the original data set 'use ABC/XYZ.dta, clear'
2. Before dropping cases type 'preserve' and when you need the data set as
it was before getting rid of those cases type 'restore'
The second way is probably more convenient if you do a lot of data cleaning
before running the analyses and don't want to do the entire cleaning again.
What I would generally recommend, however, is to create dummy variables that
indicate which cases to use for which analysis.
This way you can easily run the analyses by typing 'analysiscommand varlist
if dummy_restriced_sample==1'; 'analysiscommand varlist if
dummy_full_sample==1'; and so forth.
Hope this solves your problem.
Regards,
Sven-Oliver Spieß
Lampertheimer Str. 127a
D-68305 Mannheim
+49 (0)621-72492805
Get Skype and call me for free.
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Choudry T Shehzad
> Sent: Friday, August 29, 2008 2:13 PM
> To: [email protected]
> Subject: st: restoring dataset
>
> Dear Statalisters:
>
> I have a question. After using the command "keep" or "drop" and running
> an analysis, how can i ask stata to use all the data again. The problem
> starts when I run command e.g. for a subset of years and later I want
> to
> run command on whole years in the same do file again.
>
> Thanks,
>
> Shehzad
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/