Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Confusion about one sided p value

    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:
    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 2:
    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
    Last edited by Mike Kraft; 28 Aug 2023, 05:40. Reason: I have edited code 1 as it contained an error. I have also added explanation of the predicted theoretical signs in each state

  • #2
    Depends on what your null hypotheses are. See https://www.stata.com/support/faqs/s...-coefficients/

    However, to calculate the p-values from the regression output directly, you use the following formulas:
    H0: βmpg = 0 p-value = 0.567 (given in regression output)
    H0: βmpg <= 0 p-value = 1 − (0.567/2) = 0.717
    H0: βmpg >= 0 p-value = 0.567/2 = 0.284

    Comment


    • #3
      I want to have a one sided p value such that the coefficient is significant if it is significantly positive (negative) when the predicted sign is positive (negative). Thus, I think my null should be the opposite sign.

      My question is: can I simply divide the p value from the two sided test by 2 as long as the coefficient has the predicted sign and then conclude that it is significant if the one sided p value is less than 0.10?
      Last edited by Mike Kraft; 28 Aug 2023, 09:08.

      Comment


      • #4
        I want to have a one sided p value such that the coefficient is significant if it is significantly positive (negative) when the predicted sign is positive (negative). Thus, I think my null should be the opposite sign.

        My question is: can I simply divide the p value from the two sided test by 2 as long as the coefficient has the predicted sign and then conclude that it is significant if the one sided p value is less than 0.10?
        Last edited by Mike Kraft; 28 Aug 2023, 09:09.

        Comment


        • #5
          I do not follow, sorry. You do not determine the null hypothesis from the result, you start with a specified null before running a test.

          Comment


          • #6
            Hi
            I am referring to this post hhttps://www.statalist.org/forums/for...one-sided-test specifically post # 3 by Clyde Schechter where he says "In any case, I don't see the need for anything nearly this complicated. The p-value of this 1-tailed test is simply half the pvalue of the 2-tailed version."

            Thus my question is that can I simply divide the p value from the two sided test by 2 as long as the coefficient has the predicted sign and then conclude that it is significant if the one sided p value is less than 0.10?

            Comment


            • #7
              Yes, you can do that in any situation where the critical regions for positive and negative results are the same. The example you link to was a simple -regression-, so that certainly applies there. I don't know what -mswitch- does, nor what kind of test statistic it produces. But if a negative result of a given magnitude would yield the same p-value as a positive result of the same magnitude, this same simple approach would apply.

              Comment


              • #8
                Thanks Clyde Schechter!
                mswitch is a markov switching model where I jave only one dependent and one independent so I think your example with the one sided p value applies here.
                Also mswitch produces z stats or p value but -test- will give me the chi aquared and p value. Thus, I am simply dividing the p value from -test- by 2 as in code 2 in post #1.
                If the one sided p value is less than 0.10 , I conclude that the coefficient is significant at the 10 percent level using a one sided test.
                Does this make sense now?

                Comment


                • #9
                  Yes, this sounds right.

                  Comment

                  Working...
                  X