Hi, I have the following code where my regressions work just fine as a standalone, but when I add a condition that, in order to run the regression it must meet the criteria of a 31 day window (which is intentional and we know works for many cases), then the commands in the curly braces doesnt actually execute:
* Run the regressions
noisily{
if r(max)==31{
reghdfe shortinterest_adr ib0.windowcount#year [aweight = yearlymarketcap], abs(isinn) vce(cl isinn) nocons
mat = r(table)
matrix tmp = r(table)[1..2, "17.windowcount#2007.year".."17.windowcount#2019.y ear"]
}
}
mat tmp=tmp'
clear
svmat tmp, names(col)
gen year=_n+2006
gen lb=b-1.96*se
gen ub=b+1.96*se
I know it doesn't execute because when I try to transpose my tmp matrix, I get the error "tmp not found". I've tried to even add intentional breaks, such as putting xxx after my regression line, and it doesn't break, whereas it should say "command xxx is unrecognised". Not sure why this is an issue as we had this running just fine previously. Does anyone have thoughts on this?
Thanks!
* Run the regressions
noisily{
if r(max)==31{
reghdfe shortinterest_adr ib0.windowcount#year [aweight = yearlymarketcap], abs(isinn) vce(cl isinn) nocons
mat = r(table)
matrix tmp = r(table)[1..2, "17.windowcount#2007.year".."17.windowcount#2019.y ear"]
}
}
mat tmp=tmp'
clear
svmat tmp, names(col)
gen year=_n+2006
gen lb=b-1.96*se
gen ub=b+1.96*se
I know it doesn't execute because when I try to transpose my tmp matrix, I get the error "tmp not found". I've tried to even add intentional breaks, such as putting xxx after my regression line, and it doesn't break, whereas it should say "command xxx is unrecognised". Not sure why this is an issue as we had this running just fine previously. Does anyone have thoughts on this?
Thanks!
Comment