Hi,
I would like to record the t-stat of the ttest of the following regression: w_H => w_L. The following command gives me the p-value but not the t-stat. I would like to record it in Excel with the command "putexcel". Who can I do that? Thanks.
I would like to record the t-stat of the ttest of the following regression: w_H => w_L. The following command gives me the p-value but not the t-stat. I would like to record it in Excel with the command "putexcel". Who can I do that? Thanks.
Code:
sysuse auto, clear xtile weight_HL=weight, nquantiles(2) gen w_H=1 if weight_HL==2 replace w_H=0 if weight_HL==1 gen w_L=1 if weight_HL==1 replace w_L=0 if weight_HL==2 regress price w_H w_L weight length mpg, noconstant test _b[w_H] = _b[w_L] local sign_d_HL = sign(_b[w_H] - _b[w_L]) display "Ho: coef (w_H-w_L) => 0 p-value = " 1-ttail(r(df_r),`sign_d_HL'*sqrt(r(F)))
Comment