Announcement

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

  • importing data from R

    I have a data set in R that I want to analyse with Stata12. Is there a way to import the data directly into Stata?

  • #2
    IIRC, the foreign package will write a Stata v10 file, which you can then read with Stata 12.

    Comment


    • #3
      Stata will read several types of databases. Running help import in Stata will show what those different types are. A natural choice, as Phil has pointed out, is to export to a Stata file from R, and then read that into Stata. But there are alternatives, e.g. comma-separated or tab-separated files. Choose the one that best suits your needs.
      You should:

      1. Read the FAQ carefully.

      2. "Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly!"

      3. Describe your dataset. Use list to list data when you are doing so. Use input to type in your own dataset fragment that others can experiment with.

      4. Use the advanced editing options to appropriately format quotes, data, code and Stata output. The advanced options can be toggled on/off using the A button in the top right corner of the text editor.

      Comment

      Working...
      X