Statalist


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

Re: st: Deleted a ROW


From   Shehzad Ali <[email protected]>
To   [email protected]
Subject   Re: st: Deleted a ROW
Date   09 Aug 2008 14:44:59 +0100

Thank you, Steven and Martin. Your help is spot on.
Regards,

Shehzad


On Aug 7 2008, Steven Samuels wrote:


Shehzad-

Within a Stata session, you can recover data only if you run - preserve- before making changes. However the best way to recover data is preventive.

1. Never write "save, replace". Always save to a different permanent data set. If your original data is "d01", for example, your next permanent save might be to d02. If you mistakenly drop something, it's still there in the original data.
2. Do all your final work with "do files" that you number and save.

If you take this approach, you will never lose data; you will be able recreate all your analyses and data up to any previous state. If you have mistakenly dropped some observations, for example, you can re- edit the do file; correct the -drop- statement; then rerun the do- file on the data it started with.

I've written down the protocol for data management and documentation that I follow. It is based on a 1981 article by Muller, Christiansen, and Smith , ("Guidelines for managing datasets, programs and printouts in scientific research," Computer Programs in Biomedicine 13:281-288) and on a 1985 STATA net course, co-taught by Bill Gould, if I remember rightly. The protocol is certainly not the last word (google "subversion version control"), but it works for me and I'd be happy to share it.

-Steve


On Aug 7, 2008, at 4:58 PM, Shehzad Ali wrote:


Following on from this, I wonder if there is a drop and recover option is Stata. What I mean is if you dropped observation/s or variable/s, is there a way to recover them?

Regards,

Shehzad

On Aug 7 2008, Hind Sbihi wrote:


Hi Daniel

In the absence of more information, I will assume that each row has a unique identifier. Say your identifier is number_id and you want to remove the row for number_id #49. You can use the command drop drop if number_id==49

HTH
Hind
-----Original Message-----


Date: Thu Aug 07 10:33:41 PDT 2008
From: "Daniel Sepulveda-Adams" <[email protected]>
Subject: st: Deleted a ROW
To: [email protected]

Hi,
I have a question about "Deleted a ROW", I don't know how to do that.
Thanks you for your time
Regards -- DSA
*
* 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/

--
Shehzad I Ali
Department of Social Policy & Social Work
University of York
YO10 5NG
+44 (0) 773-813-0094

*
*   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/

--
Shehzad I Ali
Department of Social Policy & Social Work
University of York
YO10 5NG
+44 (0) 773-813-0094

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index