Hi, I'm running regressions in a loop and I'm able to store the coefficients and also other corresponding variables data but I also need to store the number of observations used in each regression as I want to eliminate regressions performed with a lower no of observations. Can anyone please help me with this?
tempname jing17
postfile `jing17' YEAR Comp_code intercept gradient using jing17.dta
forvalues i = 1(1)1000 {
if(fyear[`i']>=1995) {
capture noisily regress y_reg x_reg if(co_code_dup == co_code[`i'] & fyear_dup >= fyear[`i']-5 & fyear_dup < fyear[`i'])
if _rc == 0 {
post `jing17' (fyear[`i']) (co_code[`i']) (`=_b[_cons]') (`=_b[x_reg]')
}
}
}
postclose `jing17'
Related Posts with Storing no of observations in regressions performed using a loop
Panel Data SetHello, I have a a bunch of datasets with paneldata with variables for all companies from the S&…
Year fixed effects in panel datai am using panel data from 1990 to 2017 for 43 countries. I have two alternate dependent variables "…
Reproducing outputs from finite mixture model user written package in Stata 16Hello, I am working with someone else's code applying a fmm. The below code shows an example f outp…
predicted values from repeat regression model differentHello, I ran a OLS regression model with 59,000,000 observations and 1000+ plus variables. When I …
What is the difference between" i.county|trend " and " i.county##c.trend "?In the process of learning the code, I found this way of writing: "i.county|trend" (county is the co…
Subscribe to:
Post Comments (Atom)
0 Response to Storing no of observations in regressions performed using a loop
Post a Comment