Announcement

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

  • Making a histogram from a table of frequencies

    Hello,

    I would like to make a histogram from a table that shows how frequent choices 1, 2, and 3 were made.
    How can I approach this?

    Thanks,
    Michael

    Code:
    input choice frequency
    1 3
    2 10
    3 17
    end

  • #2
    Code:
    clear
    input choice frequency
    1 3
    2 10
    3 17
    end
    preserve
    expand frequency
    histogram choice,discrete freq xlabel(1(1)3) 
    restore
    Which produces:

    Click image for larger version

Name:	hist.png
Views:	1
Size:	27.8 KB
ID:	1594376

    Comment


    • #3
      This is the other option:
      Code:
      graph bar frequency, over(choice)

      Comment


      • #4
        Also

        Code:
        histogram choice [fw=freq], freq barw(0.9) discrete xla(1/3)

        Comment


        • #5
          Thanks for all the help, folks!

          Comment

          Working...
          X