Announcement

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

  • Newbie question

    I have a database with data of payments by certificate. Each certificate is given to a worker, who could have many in a given year. Each certificate is also clasified by employer and region.
    I need to make an histogram of the amount of payments by worker and by employer (I mean, considering the total amount a worker or an employer receives), but the standard Stata command give results considering only the amount by certificate.

    Surely there is a way, but I am a beginner.

    Any help would be appreciated.

    The database es like the following, with nearly one million records:

    Certificate_number WorkerID EmployerID Region Amount
    1 1 1 1 10
    2 1 1 1 9.75
    3 1 1 1 8.2
    4 2 1 1 9.5
    5 3 2 2 10.2
    6 4 3 2 9.9
    7 4 3 2 9.75
    8 5 4 2 9.75
    9 6 5 3 9.75

    Thanks a lot

  • #2
    Please edit your question title while there is time to something more meaningful such as "Histograms for different levels of aggregation". That way the thread may be of some use to others. The point about the forum is not just to give personal replies in public, but to provide an archive of answers that others may access.

    Technique here is illustrated by

    Code:
     
    egen WorkerAmount = total(Amount), by(WorkerID) 
    egen tagID = tag(WorkerID)
    histogram WorkerAmount if tagID

    Comment


    • #3
      Thanks a lot.
      I was unable to edit the post´s title. I will try again later

      Comment


      • #4
        My understanding is that you can do that within one hour of posting. Meanwhile you can use the "Contact Us" to ask for use of a full real name, e.g. Claudio Huckleberry.

        Comment

        Working...
        X