Announcement

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

  • Event history analysis: generate an event variable


    I have data on the date entreprises have been created and the date at which the same entreprises have formally registered.
    I want to create two variables: a duration variable and an event ( registered or not- binary 1/0) variable.

    I generated the duration variable as follows:

    duration=date2 - date1

    How can I generate the event variable?

    Is the duration variable correctly generated?
    ID Date of creation=date1 Date of registration=date2
    1 2003 2003
    2 1990 1994
    3 1978 1978
    4 1954 1955
    5 2001 2001
    6 1990 1995
    7 2005 2010
    Thank you

    Jean

  • #2
    Jean:
    as far as I can get your data excerpt, there's no need to create an event variable, as all your -id- get registered sooner or later.
    The duration variable is correct (I assume that you want to highlight the time elapsed from enteprise creation to its registration.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you Carlo. Your answer prevents me from pursuing a false route. One last question: If I fix a cut off date, let us say the year 2003. Would it be possible to generate an event variable since certain variables would be right censored. Kindly advise.

      Comment


      • #4
        Jean:
        yes you can.
        If you set a cut-off date, you will have right-censored data.
        I think that you could benefit from taking a look at the -st- entries in Stata .pdf manual.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you. I will

          Comment

          Working...
          X