Announcement

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

  • Formatting of histogram

    Click image for larger version

Name:	var test data.png
Views:	1
Size:	9.9 KB
ID:	1692954




    I am new to using stata to produce graphics and just wanted to get advice on the layout of a histogram produced by the hist command, using the data above.

    I plot data using the command:

    Code:
    hist var, freq
    The plot produced has staggered gaps between bars, for reasons that I'm not completely sure. Is this a formatting issue, or am I missing something in the data?

    Below I have copied the produced figure and also the data itself.

    Any advice would be greatly appreciated.
    Click image for larger version

Name:	hist var freq.jpg
Views:	1
Size:	17.2 KB
ID:	1692953




    var Freq. Percent Cum.

    11 1,406 20.09 20.09
    12 1,385 19.79 39.88
    13 977 13.96 53.84
    14 871 12.45 66.29
    15 569 8.13 74.42
    16 388 5.54 79.97
    17 277 3.96 83.92
    18 230 3.29 87.21
    19 174 2.49 89.70
    20 129 1.84 91.54
    21 113 1.61 93.16
    22 95 1.36 94.51
    23 82 1.17 95.68
    24 72 1.03 96.71
    25 40 0.57 97.28
    26 42 0.60 97.89
    27 29 0.41 98.30
    28 22 0.31 98.61
    29 24 0.34 98.96
    30 14 0.20 99.16
    31 9 0.13 99.29
    32 8 0.11 99.40
    33 13 0.19 99.59
    34 8 0.11 99.70
    35 4 0.06 99.76
    36 7 0.10 99.86
    37 6 0.09 99.94
    38 4 0.06 100.00

    Total 6,998 100.00
    Last edited by Tamara Sharp; 11 Dec 2022, 10:16.

  • #2
    You need the discrete option.

    Comment


    • #3
      Originally posted by Nick Cox View Post
      You need the discrete option.
      Thank you Nick, yes that completely solves the issue. Really appreciate the reply.

      Comment

      Working...
      X