Announcement

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

  • putdocxcrosstab contribution on SSC

    Putdocxcrosstab is a crosstabulation tool for putdocx like tabulate two-way.
    Options:row/column percentages, turn off/on row/columns, missingness, percent % format, table header
    (Submitted to SSC should be up soon)

    PHP Code:
    capture program drop putdocxcrosstab
    ssc install putdocxcrosstab
    sysuse auto 
    clear
    egen pricecat 
    cut(price), at(0,5000,10000,999999label
    label variable pricecat 
    "Price (categorical)"
    tab pricecat foreign
    putdocx clear
    putdocx begin
    putdocxcrosstab pricecat  foreign
    putdocxcrosstab pricecat  foreign 
    norowsum 
    putdocxcrosstab pricecat  foreign 
    nocolsum
    putdocxcrosstab pricecat  foreign 
    norowsum nocolsum


    putdocxcrosstab pricecat  foreign 
    row
    putdocxcrosstab pricecat  foreign 
    col
    putdocxcrosstab pricecat  foreign 
    row nofreq
    putdocxcrosstab pricecat  foreign 
    col nofreq

    putdocx save 
    "auto.docx"replace 
    Example output:
    PHP Code:
    putdocxcrosstab pricecat  foreign 
    Click image for larger version

Name:	ct1.png
Views:	1
Size:	5.9 KB
ID:	1434318

    PHP Code:
    putdocxcrosstab pricecat  foreign norowsum 
    Click image for larger version

Name:	ct2.png
Views:	1
Size:	5.6 KB
ID:	1434319

    PHP Code:
    putdocxcrosstab pricecat  foreign nocolsum 
    Click image for larger version

Name:	ct3.png
Views:	1
Size:	5.4 KB
ID:	1434320

    PHP Code:
    putdocxcrosstab pricecat  foreign norowsum nocolsum 
    Click image for larger version

Name:	ct4.png
Views:	1
Size:	5.0 KB
ID:	1434321


    PHP Code:
    putdocxcrosstab pricecat  foreign row 
    Click image for larger version

Name:	ct5.png
Views:	1
Size:	7.8 KB
ID:	1434322

    PHP Code:
    putdocxcrosstab pricecat  foreign col 
    (can't post image, only five allowed)
    PHP Code:
    putdocxcrosstab pricecat  foreign row nofreq 
    (can't post image, only five allowed)
    PHP Code:
    putdocxcrosstab pricecat  foreign col nofreq 
    (can't post image, only five allowed)

  • #2
    PHP Code:
    putdocxcrosstab pricecat  foreign col 
    Click image for larger version

Name:	ct6.png
Views:	1
Size:	7.8 KB
ID:	1434324

    PHP Code:
    putdocxcrosstab pricecat  foreign row nofreq 
    Click image for larger version

Name:	ct7.png
Views:	1
Size:	6.7 KB
ID:	1434325


    PHP Code:
    putdocxcrosstab pricecat  foreign col nofreq 
    Click image for larger version

Name:	ct8.png
Views:	1
Size:	6.6 KB
ID:	1434326


    Comment


    • #3
      Thanks for providing this. Just what I was after. Can confirm this is now available via ssc install putdocxcrosstab.

      One initial problem I encountered was with noROWSum and noCOLSum options. For other users, please note these should be specified in all lowercase i.e. norowsum, nocolsum, as indicated in the example above, but not as shown in the current help file within Stata.

      Also, is there any way to fix the gap between the digits and the % symbol? Above it looks like a single space, but in my document this is 4 spaces

      Otherwise, very helpful package.

      Thanks

      James

      Comment


      • #4
        Many thanks! Just what I needed. My only problem is that I wish I had looked here earlier before reinventing the wheel (badly).

        Rachel

        Comment


        • #5
          There are quite a few similar commands out there, including: https://www.statalist.org/forums/for...r-a-manuscript

          Comment


          • #6

            Do you know how remove or change the grey title?

            My language is spanish then this title not help me too much.

            Comment

            Working...
            X