Hello
I have the following code that I am using to find the threshold value. I want to find the value for the headline cpi inflation rate beyond which I get insignificant results but my matrix keeps displaying the same values for coefficients and p-values from different iterations. How can I get different results for iterations at each `j'?
My data looks like this:
Thank you!
I have the following code that I am using to find the threshold value. I want to find the value for the headline cpi inflation rate beyond which I get insignificant results but my matrix keeps displaying the same values for coefficients and p-values from different iterations. How can I get different results for iterations at each `j'?
Code:
use "\\Client\H$\Desktop\data\mainfile.dta", clear
drop if year_T>2011
matrix results = J(11, 2, .)
local row = 1
forvalues j=90/100 {
gen new`j' = hcpi_a > `j'
bys country: egen new_new`j' = max(new`j')
drop if new_new`j' == 1
csdid hcpi_a, ivar(country_code) time(year) gvar(year_T)
estat simple
matrix results[`row', 1] = r(table)[1,1]
matrix results[`row', 2] = r(table)[4,1]
local row = `row' + 1
}
matrix list results
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int year str3 country float(hcpi_a treat year_T country_code) 1980 "AFG" 13.4 0 0 1 1981 "AFG" 22.2 0 0 1 1982 "AFG" 18.2 0 0 1 1983 "AFG" 15.9 0 0 1 1984 "AFG" 20.4 0 0 1 1985 "AFG" 8.7 0 0 1 1986 "AFG" -2.1 0 0 1 1987 "AFG" 18.4 0 0 1 1988 "AFG" 27.5 0 0 1 end
Thank you!

Comment