Just to preface this: I have limited control over the structure of the project, so I am trying to figure out how to work within what I have been given. I am encountering an issue trying to produce a coefficient plot using multiple models when those models cannot be produced in the same run of a do file. What I have is a master file that is used to set global macros, which then dictate which other do files are executed. One of these do files that can be executed contains a number of variations of similar regressions. The way that things are currently set up, only one of those regression variations can be run at any given time and is dictated by the global macro "comp". I will try to illustrate below with an extremely truncated version:
Master do file general structure:
which then calls upon a file with the rough structure:
The issue I am finding is that if I try to run each version of the regression from the master do file--as intended by the project structure--the 'clear all' command would erase any stored estimates or matrices from previous versions of the regression. The only idea that I have had so far is to store the results in a matrix, create variables from that matrix, and save those variables as a Stata dataset for each regression and then merge those datasets all together and convert back to a matrix to use coefplot. I don't know if there is a better way, or if I am missing something extremely obvious here.
Please let me know if you need any clarification.
Master do file general structure:
Code:
clear all global runCOMPARISON "YES" if "$runCOMPARISON" == "YES" { global comp "B" do "${resultspath}/programs/COMPARISON.do }
Code:
if inlist("$comp", "B") { reghdfe x y z } if inlist("$comp", "C") { reghdfe x z w } if inlist("$comp", "E") { reghdfe x y w } if inlist("$comp", "G") { reghdfe x w u }
Please let me know if you need any clarification.
Comment