Announcement

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

  • Histogram

    Hi,

    I am trying to create an histogram of the variable x with frequency but of the variable weights, that has the number of cases of each value of variable x, and not the number of observations in the dataset.
    s i x weights
    0 1 0.1 1300
    0 2 0.1 1257
    0 3 0.2 1793
    1 4 0.5 450
    1 5 0.7 2550
    1 6 0.8 23
    1 7 0.6 6549
    1 8 0.4 382
    1 9 0.1 20942
    Anyone knows how can I achieve it?

    Thanks,

    Tessa

  • #2
    Code:
    histogram x [fweight = weights]

    Comment


    • #3
      If for some reason multiples of 0.1 are the only possible values, then declaring your histogram discrete may be a good idea.
      Last edited by Nick Cox; 05 Apr 2023, 00:32.

      Comment

      Working...
      X