Announcement

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

  • How to get p values in -mi estimate- commands like in R

    Hi,
    Is there a way to get precise p values in Stata using multiple imputed data like its provided in R?
    For instance, R provides p values like <2e-16, 5.3E-06, 3.0E-07, etc., but Stata just gives me 0.000
    Code:
    mi estimate: regress y x c1 c2 c3 if z1!=. & z2<30

  • #2
    Code:
    mi estimate...
    matrix list r(table)
    Best wishes

    (Stata 16.1 MP)

    Comment


    • #3
      I will not comment on the usefulness of p-values in general and especially p-values with more than 4 digits.

      To elaborate on Felix answer: Coefficients, etc. are stored and accessible in r(table). You can extract single p-values as, e.g.,

      Code:
      display %21.20f el(r(table), 4, 1)
      or, you can display all values in the table with 20 digits as

      Code:
      matlist r(table) , format(%21.20f)

      Comment


      • #4
        Many thanks. -matrix list r(table)- provides the p-values in the format I want but is it possible to get it after every -mi estimate- command in output table instead of having to type -matrix list r(table)- after every mi estimate command?

        Comment


        • #5
          No. The display format of p-values in estimation tables is controlled by the pformat() option (or set format); you can have a maximum width of 5 with 4 digits.

          Comment


          • #6
            Maybe esttab in the estout package provides a solution (http://repec.sowi.unibe.ch/stata/estout/). I am not sure but there you can at least create nice regression tables for exporting with flexible formats.
            Best wishes

            (Stata 16.1 MP)

            Comment


            • #7
              Many thanks to both. After playing for s bit, I am now using the following format that seems to give similar format of p-values as in R

              Code:
              set pformat %5.2e

              Comment

              Working...
              X