Hi everyone,
I am trying to get the p-value associated with a one-sided test (that the coefficient from a nonlinear transformation via testnl) is less than zero. I've spent a while trying to get it to work, but some things not working.
Here's what I've done:
reghdfe depvar $rhsvars $X year*,a(cid ind) vce(cluster ctyind)
estadd local hasX "Yes", replace
estadd local hasyr "Yes", replace
estadd local hascty "Yes", replace
estadd local hasind "Yes", replace
quietly reg depvar $rhsvars $X year* i.cid i.ind, cluster(ctyind)
testnl (1+1/_b[ddd])=0
mat temp1a=vecdiag(cholesky(diag(vecdiag(e(F)))))
display "Ho: coef <= 0 p-value = " ttail(r(df_r),temp1a*sqrt(r(F)))
The problem is that, while the "display" last line works fine, how do you save it to a matrix? I tried doing "mat =", but that gives an error. I'm not sure how else to add a scalar via "estadd scalar" so that I can include it in my esttab results.
Thank you for your help!
FYI, I am using the "reghdfe" package, but the regular "reg" with i.year etc FEs would also work just fine. Note ddd is a variable included in the global $rhsvars.
I am trying to get the p-value associated with a one-sided test (that the coefficient from a nonlinear transformation via testnl) is less than zero. I've spent a while trying to get it to work, but some things not working.
Here's what I've done:
reghdfe depvar $rhsvars $X year*,a(cid ind) vce(cluster ctyind)
estadd local hasX "Yes", replace
estadd local hasyr "Yes", replace
estadd local hascty "Yes", replace
estadd local hasind "Yes", replace
quietly reg depvar $rhsvars $X year* i.cid i.ind, cluster(ctyind)
testnl (1+1/_b[ddd])=0
mat temp1a=vecdiag(cholesky(diag(vecdiag(e(F)))))
display "Ho: coef <= 0 p-value = " ttail(r(df_r),temp1a*sqrt(r(F)))
The problem is that, while the "display" last line works fine, how do you save it to a matrix? I tried doing "mat =", but that gives an error. I'm not sure how else to add a scalar via "estadd scalar" so that I can include it in my esttab results.
Thank you for your help!
FYI, I am using the "reghdfe" package, but the regular "reg" with i.year etc FEs would also work just fine. Note ddd is a variable included in the global $rhsvars.