Announcement

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

  • How to generate percentage values in a 3 way frequency table?

    Dear Friends;

    I am trying to work out my descriptive tables where I have to obtain a table of corresponding values between 2 variables, further segregated by a third variable. The command
    <table Dum_Gender LC4, by(LC3) contents(freq) column> is working fine, but I want the corresponding percentage values also.
    Dum_Gender is a dummy for Females=1 and Males=0
    LC4 is a categorical variable with 3 values of Never, Sometimes, Often
    LC3 is also a categorical variable with 2 values of Faced Violence and Not faced violence
    Image attached for reference
    Click image for larger version

Name:	Screen Shot 2019-09-03 at 4.34.46 pm.png
Views:	1
Size:	68.5 KB
ID:	1514843



    Kindly advice.
    Regards

  • #2
    tabulate Dum_Gender LC4, by(LC3) row
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Many thanks for your reply. I tried the above command but it threw up an error as stated below:
      . tabulate Dum_Gender LC4, by(LC3) row
      option by() not allowed
      r(198);

      I then tried <table Dum_Gender LC4, by(LC3) row> and it did not give percentages either. Screenshot attached
      Click image for larger version

Name:	Screen Shot 2019-09-04 at 9.23.49 am.png
Views:	1
Size:	79.6 KB
ID:	1514955

      Comment


      • #4
        I figured this out myself from the STATA manual. Posting it here for the benefit of colleagues who might face a similar issue. The key is to use <by> command in conjunction with <tabulate> command to prepare n way tables with frequency and percentage
        by LC3: tabulate Trust_Police LC4, chi column

        Comment

        Working...
        X