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?
Non-staggered treatment and no control group: DID2SI am looking at the impact of covid on labor demand. All the regions in my sample receive the treatm…
How do I calculate specific time lapses?Hello, Statalisters. I am working with a prescription database, in which a patient may have one or m…
Hello ! Problems in setting up Maximum Likelihood Estimation of Fixed Effects Linear Regression Model via Optimize routine on MataHello, I have a bit of a silly problem in setting up Maximum Likelihood Estimation of Fixed Effects…
Testing whether marginal effects are statistically different from one anotherHello, I am using the "margins" command following a Tobit model and I would love to know if there i…
Dummy variable coefficients are getting automatically omitted by Stata : what to do to keep them ?I am currently trying to replicate Section 4.1. of a paper by "On the Heterogeneous Effects of Sanct…
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