Announcement

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

  • overlap between multiple time periods against one time period

    I need to find the presence of a person while a project ran, but I cannot double count overlapping presence since I need to calculate the ratio of ANY PRESENCE to the full project period, so double counting the overlap between two or more officer presence will exaggerate the presence.
    ProjectID ydate Country Project ApprovalDate Project DeactivationDate Officer Officer tenure startdate Officer tenure enddate
    1 1996 Brazil 20-Jun-96 30-Jun-02 Person 1 1-Jan-95 1-Jul-97
    1 1997 Brazil 20-Jun-96 30-Jun-02 Person 2 1-Sep-97 1-May-99
    1 1999 Brazil 20-Jun-96 30-Jun-02 Person 3 1-May-99 1-Oct-01
    1 2000 Brazil 20-Jun-96 30-Jun-02 Person 4 16-Feb-93 1-Jul-00
    1 2001 Brazil 20-Jun-96 30-Jun-02 Person 5 1-Sep-01 1-Nov-02
    1 2001 Brazil 20-Jun-96 30-Jun-02 Person 6 1-Oct-01 25-Jul-05
    1 2002 Brazil 20-Jun-96 30-Jun-02 Person 7 2-Nov-92 1-Nov-02
    1 2002 Brazil 20-Jun-96 30-Jun-02 Person 8 1-Nov-02 1-Nov-03
    So essentially I need to see if while the project ran from 20June96-30Jun2002 how much of that period was any officer present and if there were more than 1 officers present at some time then only need one officer's presence, cannot double count overlapping presence as more number of days

  • #2
    You didn't get a quick response. You'll increase your chances of a helpful answer by following the FAQ on asking questions - provide Stata code in code delimiters, Stata output, and sample data using dataex. Also, try to reduce the code you include to what is needed to demonstrate your problem. You should also have searched for the major terms in your question from the command window of Stata (findit majorterm) and in the subject index in the documentation (under index at the bottom of the list of documentation).

    While some others may have an elegant way to do this, I looks to me like this will take some serious programming. If the sample is not extremely large, I'd be tempted to sort on startdate and do this manually. It is not clear what the Country variable means.

    Comment

    Working...
    X