Announcement

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

  • Two way table with column percentage format change - how can I move the percentage next to the frequency?

    Hi all,

    This is my first post on STATALIST and I'm thrilled to join this community!

    I want to create cross country comparison on three countries and compare percentage differences between them, that looks something like this:
    How did you meet your spouse? Country A Country A Country B Country B Country C Country S
    Frequency Percentage Frequency Percentage Frequency Percentage
    Work
    Friend
    I ran two way table: tab country var1, col
    But my frustration is that I can only produce column percentages below the frequency.
    Is there a way to move the column percentage next to the frequency?

    Thank you all in advance.

  • #2
    I'm a little confused by your example but I'm assuming that the right-most header is a typo - the general answer to your question is in the third of Chuck Huber's 7 blogs on the new -table- command: https://blog.stata.com/2021/06/24/cu...assic-table-1/

    Comment


    • #3
      Thank you for asnwering my question Rich! And yes, country S was a typo. Good guess..
      So you are suggesting that I customize a two way table, then create columns and use fvfrequency and fvpercent.

      I have one more follow-up question. I created the basic table, did the following command and STATA keeps telling me that the option statistics not allowed. Do you have any idea why?
      The command was this:
      tabulate (var) (country), statistics(fvfrequency var) statistics(fvpercent var)


      I referred to the following STATA manuals.

      https://www.stata.com/manuals/rtablesummary.pdf
      https://www.stata.com/manuals13/rtable.pdf

      Thank you!

      Comment


      • #4
        statistics is an option for the -table- command but not for the -tabulate- command

        Comment


        • #5
          You are right. Why didn't I see that? Thank you!!

          Comment

          Working...
          X