Announcement

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

  • Increase number of decimals of p-value after metareg and lincom commands

    Hello,

    The journal we are submitting our work to is asking for p-values with four decimal places, i.e. p<0.0001. The p-values of the different variables included in the metaregression model give only three decimals using metareg (e.g. 0.000). Is there a way to change the display of the p-values so that they show four decimals?
    After the metareg command I am using the lincom command to combine the results of different variables. Also here I need the lincom command to give me p-values with four decimals.

    My code for metareg looks as follows:

    Code:
    metareg log_effect var1 var2 var3, wsse(log_se) eform noconstant
    The following code using lincom looks:

    Code:
    lincom var1+var2, eform
    Thank you very much in advance.
    Best wishes
    Jennyfer

  • #2
    You may type -return list- immediately after the -lincom- command to see what has been returned. There you will find the returned scalar -r(p)- contains the full precision value for the p-value (and likewise for the other estimates).

    Comment


    • #3
      Thank you. I tried but - return list, all - gives only r(df), r(se) and r(estimate). It does not give r(p). Is there a way to get r(p)? Thanks again!

      Comment


      • #4
        Originally posted by Jennyfer Wolf View Post
        Thank you. I tried but - return list, all - gives only r(df), r(se) and r(estimate). It does not give r(p). Is there a way to get r(p)? Thanks again!
        Sorry, I can't replicate your problem. Also, I misread your initial meta regression command as that bundled with Stata 17 (-meta regress-), however you are using -metareg- (Stata Journal, volume 8, number 4: sbe23_1) as you are asked to explain.

        Nevertheless, -lincom- is supported by both and as a result, behaves the same way regardless of the command. Here is an example that shows -r(p)- following -metareg- and -lincom-;

        Code:
        use "https://www.stata-press.com/data/r17/bcgset", clear
        metareg _meta_es latitude_c, wsse(_meta_se)
        lincom latitude_c
        ret list
        di r(p)
        Selected output

        Code:
        . lincom latitude_c
        
         ( 1)  latitude_c = 0
        
        ------------------------------------------------------------------------------
            _meta_es | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 (1) |  -.0291017   .0082014    -3.55   0.005    -.0471529   -.0110505
        ------------------------------------------------------------------------------
        
        . di r(p)
        .00456505

        Comment


        • #5
          Thank you very much again. Unfortunately it doesn't work for me. Even when I run your example code I do not get any output after di r(p).

          Code:
          . lincom latitude_c
          
           ( 1)  latitude_c = 0
          
          ------------------------------------------------------------------------------
              _meta_es |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   (1) |  -.0291017   .0082014    -3.55   0.005    -.0471529   -.0110505
          ------------------------------------------------------------------------------
          
          . ret list
          
          scalars:
                           r(df) =  11
                           r(se) =  .0082014173927029
                     r(estimate) =  -.029101724820489
          
          . di r(p)
          .
          
          .
          end of do-file
          Thank you very much nevertheless for your time and help.
          Best wishes
          Jennyfer

          Comment


          • #6
            What version of Stata are you using? And what is the result of the following code:

            Code:
            which metareg
            The code example above works in Stata 16 or newer. This is the version of -metareg- that I have.

            Code:
            . which metareg
            c:\ado17\plus\m\metareg.ado
            *! v2.6.1 Roger Harbord 4 Nov 2008
            *! v1.06 copyright Stephen Sharp January 1998  STB-42 sbe23
            Nevertheless, you can compute the p-value by hand if you have the estimate, SE and df on the *untransformed* scale.

            Code:
            lincom latitude_c   // do not use eform if you want the p-value
            di 2*(1 - ttail(r(df), r(estimate)/r(se)))

            Comment


            • #7
              Thank you so much again. So the reason is that I am using an older Stata version. I have the same version of metareg as you.
              But I now use the code you provided to compute the p-value by hand. So problem solved!
              Best wishes
              Jennyfer

              Comment


              • #8
                For those reading this thread, either now or at a later date, let me share a reminder of the advice given in the Statalist FAQ linked to from the top of the page.

                The current version of Stata is 17. Please specify if you are using an earlier version; otherwise, the answer to your question may refer to commands or features unavailable to you.

                ...

                If you are using community-contributed (also known as user-written) commands, explain that and say where they came from: the Stata Journal, SSC, or other archives. This helps (often crucially) in explaining your precise problem, and it alerts readers to commands that may be interesting or useful to them.

                Here are some examples:
                I am using xtreg in Stata 16.1.
                I am using estout from SSC in Stata 16.1.

                Comment

                Working...
                X