Announcement

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

  • edit summary table using tabout

    Hi everyone,

    I am student, recently using stata, having touble with the use of the command tabout:

    I need the output table be like this, in a txt file
    SALES BY GENDER
    Gender Sum Sales_2023 N Sales_2023 Sum Sales_2022 N Sales_2022
    Male 33866790 2516 30866790 1835
    Female 2626634 849 1626634 606

    The command i am using is this

    tabout Gender using sales_by_gender.txt, cells(sum sales_2023 N sales_2023 sum sales_2022 N sales_2022) ptotal(none) format(0c) dpcomma sum

    I am getting this table, the problem is that i can't figure how to create the title of the table and also edit the colum names so that the N and Sum appear inside the variables and not above the table
    Sum N Sum N
    Gender Sales_2023 Sales_2023 Sales_2022 Sales_2022
    Male 33866790 2516 30866790 1835
    Female 2626634 849 1626634 606
    thanks for any help!
    regards

    Rob

  • #2
    try this:

    h2(SALES BY GENDER) h3(Gender Sum Sales_2023 N Sales_2023 Sum Sales_2022 N Sales_2022)

    Comment

    Working...
    X