I'm looking for a good way to do proper project management in Stata. Some info:
1) I have lots of data files and lots of do files, organized in directories.
2) I have a few master do files that call the other do files in subdirs, which call other do files in subdirs.
3) Every do file mostly works on data in the same (sub)dir, hence the working dir should be set to a subdir when executing a do file in a subdir.
4) Do files should also be able to run independently from the master file.
I "solved" this now by passing the subdir as argument to do files in subdirs. At the start of each do file in a subdir I check if the argument is empty. If not, the argument is used to change the working dir (called from the master). If it's empty (ran independently), the working dir is not changed.
This is of couse very cumbersome and not safe when renaming subdirs.
Stata does offer a project file format, but that is just a list of links to files, it doesn't do project management. For instance, the working dir for a project is set to the dir of the project file and all paths used should be relative to that, meaning that files can't be ram independently anymore and the code will contain many more hard coded paths, because also files in subdirs have to assume the working dir is still the project dir. So, changing a dir name using projects becomes even more unworkable (you need to check all your do files for possible references to the renamed dir).
Is there any way to do a more proper project management in Stata?
I haven't found one, so the next question: is there any decent way, without hardcoded paths as arguments, to change the working dir to the path of the do file that is running?
I have had a look at the "project" package but that does not offer me what I need.
Thanks for any advice.
Related Posts with project management in Stata
More than one change point in interrupted time-seriesDear colleagues the data below is a subset of my data that I am intending to analyse using interrupt…
Mi impute pmm nearest neighbor matchingHello, I am using mi impute pmm command and I have a question regarding nearest neighbor matching. I…
Formatting in the command: generate _registration_date = date(registration_date, "DMY")Hi, I have a string variable for the registration data and I am trying to destring it. I am running…
Deleting variables with specific values in a specific rowI would like to keep variables if the third-row value is SHD. If the third-row value is not SHD, I w…
Observe the jumps of (number of) observations and drop the outliersHello, I'ma beginner in Stata and I have some questions on observing the jumps of number of observ…
Subscribe to:
Post Comments (Atom)
0 Response to project management in Stata
Post a Comment