Announcement

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

  • Missing bin in histogram

    Help! I don't know why I am missing a bin in my histogram; only 2 are showing up. There are 3 categories.
    -----------------------------------------------------------------------
    | Freq. Percent Valid Cum.
    --------------------------+--------------------------------------------
    Valid 0 income>expenses | 2898 54.11 54.11 54.11
    1 income=expenses | 1801 33.63 33.63 87.73
    2 income<expenses | 657 12.27 12.27 100.00
    Total | 5356 100.00 100.00
    -----------------------------------------------------------------------

    Here is my code:
    histogram Income_Expenses, width(1) frequency fcolor() xtitle("Spent more than Income ") xlabel(0(1)2, labsize(vsmall) angle(forty_five) valuelabel)

    thank you.Lena
    Attached Files

  • #2
    Unless you use appropriate options to tell it otherwise, -histogram- makes decisions about which levels of the variable being processed to combine into bins. For whatever reason, it chose to combine two of your categories into 1. I guess it combined categories 1 and 2.

    Anyway, to override that default behavior, add the -discrete- option to your -histogram- command and it will include every category.

    Comment


    • #3
      Thank you Mr Schechter, it worked!! Miracle worker you are.

      Comment

      Working...
      X