Announcement

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

  • how to change regression output from scientific notation to decimal notation

    Hi everyone,
    when I run a regression (xtreg - stata 14) it produces the coefficient estimates in scientific notation (because they are really small), i want it to be in decimal notation. This is because when I use the user program outreg2 it doesn't seem capture variables over a certain size.

    I have tried changing the format of the variables in questions but i doesn't change the regression output.

    Does anyone have any experience with this? I have also looked at menu drive options in stata and it seems I can't set decimal places to more than 5, i want around 15.

    If you need more information feel free to ask

    Cheers,
    Daniel

  • #2
    I don't think there is any way to do this. I also think that's a good thing. If you try to look at a bunch of numbers with 15 decimal places, most of which are zero, you will go cross-eyed.

    What I would do in this situation to get more readily readable output is rescale the predictor variables that have very small coefficients. Say one of the predictors, x, is an amount of money denominated in dollars. Then -gen x_rescale = x/1e9- (i.e. denominate the amount in billions of dollars). Then use x_rescale instead of x in your equation. The corresponding regression coefficient will be a billion times larger, which means instead of needing 15 decimal places to see it, you will only need 6. You might even consider a factor of 1e12 here.

    Alternatively if your outcome variable y takes on values that are very small numbers and all of your coefficients are very small, you could do -gen y_rescale = y*1e12- and regress y_rescale instead of y, to bring all of the coefficients up to some more visually perceptible value.

    Comment


    • #3
      Hi Daniel,
      You can try to add option bdec() to denote decimal places

      For example:
      Code:
      outreg2 using x.xls, replace bdec(0)
      This will output integers.

      Hope this helps!
      Last edited by Yuan Yuan; 09 May 2022, 19:27.

      Comment

      Working...
      X