Announcement

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

  • Rounding the coefficients

    Dear Researchers,

    I am sorry, my question may sound silly, but I searched for the answer and the answers were different in this regard.

    Is there any code in STATA that gives you coefficients resulting from the regression test, rounded to 4 decimal places?

    If yes, does the rounding process affect other results like the confidence interval, P-value, etc?

    Many thanks in advance.

  • #2
    -help cformat-
    -help pformat-
    -help sformat-

    Comment


    • #3
      Dear Prof. Clyde,
      Thank you very much for your consideration and cooperation. Greatly appreciated.
      That is very interesting, I have read the format setting for coefficient tables, and I am using the following code:
      Code:
      set cformat %9.2f

      But, in the file, I have found that the maximum format widths for set cformat, set pformat, and set sformat in coefficient tables are 9, 5, and 8, respectively.

      So, do these numbers (9 ,5 ,8) mean the integer values??

      The above format is very interesting if I want to copy the results from stata to Excel, but If I am using the following code:
      (This code should be before the regression)
      Code:
      Eststo:
      Then
      Code:
      esttab using out3.csv,  se r2 replace
      The results are exported to Excel are in the formal format without rounding!!!

      Comment


      • #4
        The numbers 9, 5, and 8 refer to the total number of characters displayed. So, for a coefficient, the number of spaces allocated will be a maximum of 9. That means you can have 9 characters in the result, including all digits (whether before or after the decimal point), the decimal point itself, and perhaps a sign. These are generous widths: I have never known a situation where more than that is needed.

        The effects of -cformat-, -pformat-, and -sformat- apply only to the immediate Stata output. -esttab- know nothing about this, as you have seen. I do not use -esttab- myself, so I can't advise you how to deal with it, but I'm pretty sure there is some option in -esttab- that allows you to control the number of decimal places in what you display. If you read -help esttab- you'll probably find it there. If not, perhaps somebody else who uses -esttab- will jump in to help.

        Comment


        • #5
          Hi Prof. Clyde,

          Thank you very much for your answer and for your explanation.

          I have understood the issue of (9,5, 8). Thank you very much. Much appreciated.

          Regarding the esttab, I have found an old post on this website by Tamara vanderDoes, and mentioned the following:

          esttab, cells("count(fmt(3)) mean(fmt(3)) sd(fmt(3)) min(fmt(3)) p50(fmt(3)) max(fmt(3))") noobs You just need to add the number of decimlas needed for each type of estimation in your "cells" option!


          So, the above code might be useful for people here.


          But, in the case of the DID model, do you have any idea how can I do it, I mean I have tried the above code for the following model, but the stata showed me the following message:
          Code:
          unmatched quote
          And, here is the model that I have tried:
          Code:
           esttab, cells xtreg Performance i. Event##("c.Age(fmt(3)) c.Size(fmt(3)) c.growth(fmt(3))) i. year, fe cluster (COMPANY) noobs
          I am so sorry for asking again, i am so embarrassed.

          Thank you again for all your great efforts.

          Comment


          • #6
            Again, I do not use -esttab- and am not familiar with the details of its syntax. The error message clearly refers to
            Code:
             
            esttab, cells xtreg Performance i. Event##("c.Age(fmt(3)) c.Size(fmt(3)) c.growth(fmt(3))) i. year, fe cluster (COMPANY) noobs

            That " character is unmatched. The question is whether it should be removed altogether or whether you need to have another one somewhere else to match it. Sorry I can't be more helpful on this, but I just don't use this command and don't know its syntax. In any case, that quote by itself cannot be right.

            Comment


            • #7
              Dear. Prof. Clyde,

              No worries at all, and thank you very much for your answers. Greatly appreciated.

              Many thanks.

              Comment

              Working...
              X