Announcement

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

  • From Stata to Excel: digits right of decimal

    Dear all,
    I am trying to copy and paste a column of numbers from Stata to Excel. I would like to keep the digits right of the decimal. How can I keep the digits after the decimal ?
    Many thanks.
    Best,
    Lionel

  • #2
    Copy and paste should allow just that. I do this informally when something has provided a spreadsheet file and I have no personal stake in the results.

    But if you really care about the dataset and about quality and reproducibility of the results, you should almost certainly use import excel rather than copy and paste.

    But I am left wondering why you think the decimal digits are lost at all. if there is an issue you should tell us more about examples, including display formats in both places.

    Comment


    • #3
      Thank you Nick for your quick reply.
      The format of my variable in the Stata data editor is %8.0g. In the editor, no digits right to the decimal are displayed and the numbers in cells are rounded. If I look at one particular cell, I can see that my number has a lot of digits right to the decimal.
      If I copy and paste the column, I get the rounded numbers in Excel and no digits after the decimal.

      Comment


      • #4
        I'm wondering whether the current format in Excel's spreadsheet "forbids" the decimals. Maybe you'll need to select the right format in Excel before you paste the values.
        Best regards,

        Marcos

        Comment


        • #5
          I have found the solution. I had to change in the "variables manager", then in "Format", "creat"" the format from "general numeric" to "fixed numeric". I indicated 4 digits right to the decimal and 12 total digits. The cells in Stata dispaly 4 digits right to the decimal.
          I would have preferred that Excel records all the digits right to the decimal from Stata. For my use, it is sufficient to have 4 digits.

          Comment

          Working...
          X