Announcement

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

  • Data extract

    Hello Stata users,

    I am currently writing up a Stata project for my undergraduate dissertation. I would simply like to export in rtf (or any other way that makes a nice table) a small extract of data to show an example of the indentifiers in the data and the key dependent variable. The table I would like would be the same as the output from:

    Code:
     list MSOA21NM MSOA11CD Unemployment if inlist(MSOA21NM, "Wandsworth 012")
    MSOA21NM MSOA11CD Unemployment Rate
    Wandsworth 012 E02000933 3.8
    Where MSOA21NM is the 2021 MSOA name and MSOA11CD is the 2011 MSOA code. I have tried using asdoc however this doesn't work with an if clause.

    Any and all advice is appreciated.

    Best,
    Alex

  • #2
    Use -putdocx-.

    Code:
    putdocx clear
    putdocx begin
    putdocx table tablename = data(MSOA21NM MSOA11CD Unemployment) ///
        if inlist(MSOA21NM, "Wandsworth 012"), varnames
    putdocx save filename , replace
    Note: Replace the italicized portions with names appropriate to your situation.

    This will give you a "vanilla" table in a Word document. Check the help file for options available in -putdocx table- that enable you to modify the formatting of the text and table design to your taste.

    Comment


    • #3
      Many thanks, this has worked!

      Comment

      Working...
      X