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
Margins saving errorHi Statalist, I'm having trouble saving a margins dataset after running a non-parametric regression…
Name variableHello, I have a dataset with a variable called "Country". I would like to know the code to know the…
Change font size on x-axisI'm having a frustrating time automating a change in font for the x-axis using the package profilepl…
MRS/WTP estimation with effects-coded mixlogitHi, does anyone have advice on using effects-coded model for MRS/WTP estimation in DCE. Assuming I …
Creating a dummy based on a combinationHi all, I am trying to create a dummy variable based on the particular combination of two other dum…
Subscribe to:
Post Comments (Atom)
0 Response to Storing no of observations in regressions performed using a loop
Post a Comment