Announcement

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

  • Import XML data with Stata - usexmlex

    Dear Stata community,

    does anyone know how to import xml-data with Stata Version 16?

    I tried to install usexmlex, but I had no luck with importing. I tried also to follow some other google tips to import via "File --> Import --> XML data" but Stata version 16 does not show that.

    Any tips on that?

  • #2
    You might want to try - xmluse- -

    Update: Read the manual: "xmlsave continues to work but, as of Stata 15, is no longer an official part of Stata. This is the original help file, which we will no longer update, so some links may no
    longer work."
    Last edited by Marc Kaulisch; 19 May 2021, 07:20.

    Comment


    • #3
      Another way is to import it as a delimited file. Last time I needed to import a xml I adjusted code presented in https://www.statalist.org/forums/for...21#post1414721
      1. import the file with -import delimited-
      2. Create an identifier for each single case
      3. Try to get every variable name into one varaible, e.g. item_tag
      4. Try to get every value into one variable, e.g. item_value
      5. Bring both into one line/observation
      6. Drop any unnecessary lines
      7. Reshape it into wide format like: reshape wide item_value, i(id) j(item_tag) string
      Last edited by Marc Kaulisch; 19 May 2021, 07:36.

      Comment

      Working...
      X