Announcement

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

  • How to open a .dat data file in STATA?

    Hello!

    I am currently helping out on a research project that previous used SPSS to do statistical analysis, the data files came in the format of .dat.
    I couldn't open it with my STATA, and the similar posts that tackled a similar question are quite complicated for me to follow, as I am a total beginner in using STATA.

    So, is there a general way of converting the data files in a .dat format into something that can be opened by STATA?

    Thank you so much!

  • #2
    Gwen:
    welcome to this forum.
    See: https://stattransfer.com/overview/
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      With SPSS, the expected extension is .sav for the dataset.
      Best regards,

      Marcos

      Comment


      • #4
        Some years ago I often encountered data files that were text files with the extension .dat -- which didn't imply any particular format. I wouldn't therefore rule out the file being readable directly, but you'd need to ascertain that it was a text file (use a text editor or try to type it in Stata) and then find out how to read it.

        Comment


        • #5
          My experience was that, by *informal* convention, .dat was a term for a plain ASCII file, usually with fixed format, i.e., data for a given variable in the same columns on each line and with no delimiters. As Nick says, you'd need to examine it with a text editor to see if that is correct. If this is true of your .dat file, you would need the documentation for the data layout for these files, with which you could create Stata code to read them. This could be quite confusing if you have not done this sort of thing before.

          Comment


          • #6
            Welcome Gwen,
            A work-around that may be fairly simple::
            1. first import the *.dat file (which is likely to be data saved as a "text" file) into other software you are familiar with, perhaps Excel or SPSS.
            2. Then you may be better able to save it as another file format such as tab-delimited, .CSV (comma separated file) or even the Stata (".dta") or SAS or SPSS export format.
            Good luck
            Cheers, wg
            ~ ~
            sapere aude ~~

            Comment


            • #7
              ... additionally, a quick Google search turned up some step-by-step examples:
              • this link for SPSS:
              http://​​​​​​​https://wiki.education.ucsb.edu/wiki..._into_SPSS.pdf
              • and this for Excel:
              https://smartweb.ks.gov/docs/default...l.pdf?sfvrsn=4
              Cheers, wg
              ~ ~
              sapere aude ~~

              Comment

              Working...
              X