Announcement

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

  • How to create histogram/box chart that are stacked like the one below (This was generated in R I believe)

    Hi

    Just a brief summary of what I am trying to do. I want to graph a histogram of GPA values. I also have another variable called 'course taken', which contains 3 values (traditional, co-requisite & college-level). With GPA on my x-axis and number of students on my y-axis I would like to generate a graph like the one below

    Not sure whether I should use Stata's histogram option or the box graph option to create this graph. Also, how do I go about it?
    Click image for larger version

Name:	R-Graph.png
Views:	1
Size:	18.2 KB
ID:	1693560

    Last edited by Steph Cheri; 14 Dec 2022, 11:11.

  • #2
    I can't see any box plot (box chart) flavour here. It looks to me like a stacked bar chart such as you can get with graph bar.

    However, although it would be a little more work, twoway bar and rbar are more flexible here.

    It seems a little implausible that every GPA mark from 311 to 390 has values, with no gaps in the upper tail.

    What are the dashed vertical lines?

    Show some sample data, and a sample graph is likely.

    Comment


    • #3
      Hi Nick!

      Those dashed vertical lines were manually added to depict the cutoff points. Also that graph reflects ACT scores (and not GPA). But here is a simple histogram that I created with Stata with the actual values



      Last edited by Steph Cheri; 14 Dec 2022, 12:52.

      Comment


      • #4
        You're undoubtedly correct that the data in #1 are not GPAs. In my British ignorance I have never heard of ACT scores but from Googling they don't look like ACT scores either,

        But as everyone will appreciate, the graphical issue is not affected, and as yet we can see no example data.

        https://www.statalist.org/forums/help#stata explains how to post a data example using dataex.

        Comment

        Working...
        X