Overwriting Data

4 views
Skip to first unread message

Ajay Shenoy

unread,
Jun 2, 2013, 2:49:27 PM6/2/13
to income-dynam...@googlegroups.com
Hey, all,

I want to make a general announcement: when you're doing code work, never, never, NEVER overwrite the original data (for example, hh82/Deck 4).  It's already unwise to rewrite data if it's on your hard drive - you might later forget that you've modified the data and write do files assuming a set of codes or a number of observations that's wrong.  But you also run the risk of accidentally overwriting what's on Dropbox, which would be very bad since you've then screwed up everyone's code.  To avoid this you should follow these guidelines:

1) Never "cd" into the directory with the data.  It's much less likely you'll overwrite something if you're not in the same directory as it.  Instead, define a global path and use the data from whatever directory you're starting from.

2) Either create a temporary folder on your machine to save intermediate data files or use "tempfile" like I showed you.  

3) If you do use tempfile, never use the option "replace" when saving.

On a related note, don't save anything to the labeled_dta folders - someone might get confused and think whatever you've produced is actually original data.

One of the major benefits of Stata is that you keep your data processing separate from the original data.  That minimizes the chances you'll screw up your data and write an irreplicable paper.  We need to minimize the chances of errors at every stage of the project.

Thanks,
@


Reply all
Reply to author
Forward
0 new messages