Dear Colleagues,
When using large data sets, I frequently find myself in the following situation: I open the data set, add or modify some variables, realize I made a mistake, and want to revert back to the original data set but do not want to have to waste time opening the entire data set all over again. Sometimes I can identify which variables have been created and drop them, but this is tedious, error-prone, and doesn't always get back to the original condition of the data set. preserve and restore, of course, are designed for this purpose, but they are slower than re-opening the data set.
Is there any other way in Stata to reverse the effects of commands that change the data set? The only way I could think of was to use cmdlog and then parse the command log (is there another way to get at previously executed commands), go back to the last use and then start dropping variables that had been generated and perhaps in some cases reverse the effects of a replace. Of course, recovering dropped variables is probably out of the question. Does anybody think that such a command would be useful? To be really useful, StataCorp would probably have to implement it, but would a limited version be useful in the meantime?
Regards,
Joe
When using large data sets, I frequently find myself in the following situation: I open the data set, add or modify some variables, realize I made a mistake, and want to revert back to the original data set but do not want to have to waste time opening the entire data set all over again. Sometimes I can identify which variables have been created and drop them, but this is tedious, error-prone, and doesn't always get back to the original condition of the data set. preserve and restore, of course, are designed for this purpose, but they are slower than re-opening the data set.
Is there any other way in Stata to reverse the effects of commands that change the data set? The only way I could think of was to use cmdlog and then parse the command log (is there another way to get at previously executed commands), go back to the last use and then start dropping variables that had been generated and perhaps in some cases reverse the effects of a replace. Of course, recovering dropped variables is probably out of the question. Does anybody think that such a command would be useful? To be really useful, StataCorp would probably have to implement it, but would a limited version be useful in the meantime?
Regards,
Joe
Comment