Suppose you have dataset containing many variables where you have performed some analyses using only a small number of the variables. Now it is time to upload the data and .do file to a replication archive (Dataverse etc.) for replication purposes. You don't want to upload the entire dataset, but only the relevant variables; specifically, you want to give users a dataset on which they will able to run your .do file containing your analyses, which possibly includes the creation of new variables--but no unnecessary variables.
Is there an efficient way to keep (or otherwise identify) only those variables in a dataset that are referred to in a given .do file (DVs, IVs, weights, in "if conditions", etc.)--but not those that are created within the .do file?
This is not so difficult to do manually, but it would be cool if there's a way automate it.
Related Posts with Is there a way to keep only variables referred to in a given .do file?
Changing a range of ID numbers (1-3) into separate numbers 1, 2, 3I am trying to change NAICS ID variables from a string into separate individual numbers. For example…
Height for age and Height percentilesDear all, I will please like to find out how to calculate height for age as well as height percenti…
Multiple hypothesis testingHello Users, I am a new user of the stata software. I am analysing the usage of maternal care serv…
Detect duplicates using a loopDear Statalist- Community, I would like to create a dummy called "multiple" indicating whether ther…
difference to difference-introduction of minimum wage in a specific yearhi, As part of my coursework i am analysing the effect of introduction of minimum wage on employmen…
Subscribe to:
Post Comments (Atom)
0 Response to Is there a way to keep only variables referred to in a given .do file?
Post a Comment