Announcement

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

  • Exporting data from excel to Stata

    Hi Statalist,

    I have an Excel Comma Separated Values file. One of the variables is age-range:
    age-range
    "0-5"
    "15-25"

    I used
    Code:
    insheet using "U:\MBS Demographics 1993-2015\MBS Demographics 1993 Qtr3 (September).csv"
    but all values for age-range in stata is missing.

    Could you please let me know how I can export this variable to Stata properly?


  • #2
    You can try opening the csv file in Excel, highlight the column and change its format to text, save and thereafter export to Stata.

    Comment


    • #3
      Thanks for the reply.

      I did it but it does not work.

      Comment


      • #4
        Please be more specific. What happens if you copy and paste the column from Excel to Stata?

        Comment


        • #5
          Thanks for the replies.

          I solved my problem by running
          Code:
          import delimited using "U:\MBS Demographics 1993-2015\MBS Demographics 1993 Qtr3 (September).csv", stringcols(_all)
          and then destring numeric columns.

          Comment

          Working...
          X