Announcement

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

  • Showing multiple graphs together when have many groups

    Hi
    I have created a histogram of marriage ages for each ethnic group in my dataset using the by option, however there are around 100 ethnicities so each individual graph is showing up very small and hard to read. Is there a code I can use to make this look better by forming 2/3 graphs instead. Here is the code I have used
    Code:
    twoway hist agefrstmar , percent by(ethnicityall, note("") legend(off) ixaxes)
    Thank you!

  • #2
    Not with 100 different categories no there's not.

    Maybe I'm wrong, but before we continue, I guess my question for you is "what's the value of this graph/ these graphs", "what's its purpose, what's it for", right? Are 100 histograms necessary, or even 50? I ask because there's likely a better way to do what you really want to represent.

    Also, histograms are better for discrete or continous data, not really categorical data.

    Comment


    • #3
      My analysis relies on creating treatment and control groups from ages that different ethnicities typically get married. I already have tables showing the frequency for each group but I thought a graph would be better way to show the distribution of ages within each ethnicity in my paper. What type of graph would you suggest instead?

      Comment


      • #4
        Honestly I've never had to work with so many categories that I think doing so with a histogram or a more standard plot would be a nightmare. Maybe a heatmap or something? For me to give a decent suggestion, could you please show me what your data look like using dataex?

        Also, once you've done that, the person who likely has more prescient thoughts on this than me would be Nick Cox

        Comment


        • #5
          Thank you, here's part of my data
          Code:
          * Example generated by -dataex-. For more info, type help dataex
          clear
          input byte agefrstmar long ethnicityall
          12 155
          11  33
          14  33
          17  33
          12  33
          10  33
          11  33
          14 155
          17 155
          24 155
          16 155
          19 155
          32 155
          13 155
          11  33
          12  33
          16  33
          16  33
          15  33
          12  33
          12  33
          23 155
          12 155
          11  33
          15  33
          15  33
          16 155
          11  33
          14  33
          19  33
          37  33
          15  33
          13  33
          21 155
          16  33
          16  33
          17  33
          26 195
          13  33
          10  33
          15  33
          16  33
          10  33
          19  33
          15  33
          18  33
          26  33
          19  33
          20  33
          17  33
          14  33
          20  33
          16  33
          20  33
          15  33
          12  33
          11  33
          13 155
          15  33
          14  33
          12  33
          15  64
          15  33
          14  64
          16  64
          21  33
          14  33
          20  33
          13  33
          21 195
          19  33
          12  33
          36  33
          12  33
          21  75
          18 194
          24  33
          19  33
          18 155
          17 155
          20  64
          14  75
          12  33
          19  33
          22  33
          14  33
          19  33
          14  33
          15  33
          29 195
          17 155
          18  33
          20  33
          25  33
          17  33
          19  33
          18  33
          16  33
          27  33
          16  33
          end
          label values agefrstmar agefrstmar_lbl
          label values ethnicityall ethnicityall
          label def ethnicityall 33 "Bariba", modify
          label def ethnicityall 64 "Dendi", modify
          label def ethnicityall 75 "Fon", modify
          label def ethnicityall 155 "Peulh", modify
          label def ethnicityall 194 "Yoa and Lokpa", modify
          label def ethnicityall 195 "Yoruba", modify

          Comment

          Working...
          X