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
Creating a lag variableHi Stata Users I am using Stata version 15 on a dataset with about 900,000 observations. I would lik…
Chow test for structural brake in 2SLS processI am using ivregress in STATA 16. I want to understand how can I apply chow test for structural brea…
Omitted variables of collinearityI have omitted variables problem when I run linear regression with lag(1). However, I do not have pr…
spmlreg /// factor variables and time-series operators not allowedHi Stata Users I'm trying to run a Spatial Durbin Model where am using the SPMLREG. However when I …
How to add Arellano-Bond and Sargan tests results to esttab optionsDear Statalisters, I am using Stata version 14.2. to run a two-step difference GMM using the follow…
Subscribe to:
Post Comments (Atom)
0 Response to Storing first-stage statistics for 2SLS regression using regsave
Post a Comment