Announcement

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

  • transpose putdocx table (memtable)

    Dear Stata-Listener,
    i have a question about manipulating a table after putdocx (data), memtable.
    I have generated tables with the putdocx command (the code below). Everything is fine. But sometimes the varlist is too long and I have to transpose the table in the word file for better readability. I found the option memtable in putdocx. Is it possible to create a table with putdoxc (memtable), transpose this table and then export it to Word?
    Code:
    putdocx clear
    putdocx begin
    putdocx paragraph
    collapse (mean) price mpg trunk weight length turn, by( foreign)
    putdocx table tbl1 = data(" foreign price mpg trunk weight length turn"), varnames border(start, nil) border(insideV, nil) border(end, nil) memtable
    putdocx table tbl1(1,2)=("`: var label price'")
    putdocx table tbl1(1,3)=("`: var label mpg'")
    putdocx table tbl1(1,4)=("`: var label trunk'")
    putdocx table tbl1(1,5)=("`: var label weight'")
    putdocx table tbl1(1,6)=("`: var label length'")
    putdocx table tbl1(1,7)=("`: var label turn'")
    
    putdocx save myreport.docx, replace
    Any suggestions, Thanks Jörg

  • #2
    You can transpose the dataset after -collapse-:
    Code:
    xpose, clear varname

    Comment

    Working...
    X