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
Numbers cannot be correctly converted to strings by tostring commandAny help would be appreciated. I had a serious problem that numbers cannot be correctly converted to…
How to know the impacts of other variables on the DID estimate?I have searched around but didn't have any luck. I am trying to estimate and then compare the DID es…
Estimating slope at different points of intervalGood morning, I allow myself to ask for help once again with some methodology. I am doing research t…
Loops for creating categorical variables using different cutoffHi, I have 842 continuous variables and I need to turn them into a catagorical variable. Each of the…
Fixed effects using reghdfeHi all, I am using Stata 14.2 on Windows. I have a question on how to use reghdfe for my hedonic an…
Subscribe to:
Post Comments (Atom)
0 Response to Storing no of observations in regressions performed using a loop
Post a Comment