Hi
I am confused with the one-sided p-value in a regression. I have created two codes that produce similar results at the end. Are my interpretations correct? If so, can I simply use code 2?
Inflation is positive in stata 1 and negative in stata 2
Code 1:
Code 2:
I am confused with the one-sided p-value in a regression. I have created two codes that produce similar results at the end. Are my interpretations correct? If so, can I simply use code 2?
Inflation is positive in stata 1 and negative in stata 2
Code 1:
Code:
mswitch dr interest, switch(inflation) states(2) test _b[State1:inflation]==0 local sign_inflation1 = sign(_b[State1:inflation]) local pval1 = 1-normal(`sign_inflation1'*sqrt(r(chi2))) // I test it is negative (the results show that the p value is less than 0.10 so I conclude that inflation is significantly positive in state 1 using one sided test) test _b[State2:inflation]==0 local sign_inflation2 = sign(_b[State2:inflation]) local pval2 = normal(`sign_inflation2'*sqrt(r(chi2))) // I test it is positive (the results show that the p value is less than 0.10 so I conclude that inflation is significantly negativein state 2 using one sided test) outreg2 using results.xls, sym(***,**,*) pvalue excel addstat( Test1 p-val1,`pval1',Test2 p-val2, `pval2') replace
Code:
mswitch dr interest, switch(inflation) states(2) test _b[State1:inflation]==0 local pval1 = r(p)/2 //as the sign of inflation is positive as predicted, I simply divide the p value by 2. The results show that the p value is less than 0.10 so I conclude that inflation is significantly positive in state 1 using one sided test. test _b[State2:inflation]==0 local pval2 = r(p)/2 //as the sign of inflation is negative as predicted, I simply divide the p value by 2. The results show that the p value is less than 0.10 so I conclude that inflation is significantly negative in state 1 using one sided test. outreg2 using results.xls, sym(***,**,*) pvalue excel addstat( Test1 p-val1,`pval1',Test2 p-val2, `pval2') replace
Comment