Statalist


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

st: RE: restoring dataset


From   "[iso-8859-1] Sven-Oliver Spie▀" <mail@svenoliverspiess.net>
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: restoring dataset
Date   Mon, 6 Oct 2008 21:44:27 +0200

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: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Choudry T Shehzad
> Sent: Friday, August 29, 2008 2:13 PM
> To: statalist@hsphsun2.harvard.edu
> 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/



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