Hi everyone,
I am running a long loop with a number of different 2SLS regressions using ivregress. I want to store the models in a dataset, so that I can compare them and plot them against each other—which I am doing using regsave. My question is that I would like to also store the F-statistic in the first stage (which I would check outside do by running estat first after the ivregress command). Is there anyway I can build this into the loop? A sample code is below:
* Create a local with the outcomes
local outcomes outcome1 outcome2 outcome3
* Run the analyses
foreach outcome in `outcomes'{
ivregress 2sls `outcome' covariate1 covariate2 ///
(endogenous_predictor = instrument)
regsave endogenous_predictor using results.dta, ci level(95) append addlabel ///
(Outcome, `outcome', Model, 2SLS, Predictor, Predictor)
* The loop goes by repeating similar chunks of code
}
Any way I can add the estat first command in the loop and store the F value in the same results.dta dataset?
Thank you very much in advance!
Related Posts with Storing first-stage statistics for 2SLS regression using regsave
Matching one variable with another variable from different datasetHello, I have a large dataset, with 2.800.000 observations and 10 variables aproximately, and I wou…
Expression too long error while finding synthetic controlDear all, I am using Stata 15.0 to find a synthetic control group using synth command. No matter ho…
Difference-in-difference with same group but three time periodsHello Statalist community. I have a question regarding a difference-in-difference regression I want…
Anyone familiar with unit root test(s) with multiple breaks?Hi, I would like to test a time series variable for unit root. I have one model with 4 impulse dumm…
Checking one variable with another variable from different datasetHello, I have a large dataset, with 2.800.000 observations and 10 variables aproximately, and I wou…
Subscribe to:
Post Comments (Atom)
0 Response to Storing first-stage statistics for 2SLS regression using regsave
Post a Comment