Announcement

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

  • Auditor tenure

    Hi all,

    I want to create a variable, SHORT_TEN, which means 'indicator variable equal to 1 if the auditor's tenure with the firm is less than three years, 0 otherwise'.
    I want to do this by using the variable CURR_AUDSNC_DATE, meaning 'current auditor since event date' (year-month-day).
    I want to calculate the tenure of the auditor since they work for the firm, until now (2022-01-15).
    So, I want Stata to create a variable that calculates the amount of days between CURR_AUDSNC_DATE and the date of today. Does someone know how to do that?
    Or if someone knows a better solution to calculate the tenure with this data, I would like to hear it.

  • #2
    please provide a data example by typing -dataex- in Stata and copying the output in the results window

    Comment


    • #3
      Sorry, this is the data from the variable that I need to create a new one:

      input str10 CURR_AUDSNC_DATE
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "1985-12-31"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      "2014-02-15"
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      "2018-12-12"
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      ""
      "1992-12-31"
      "1992-12-31"
      "1992-12-31"
      "1992-12-31"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"
      "2010-04-19"

      Comment


      • #4
        thank you for the data example, I think this is what you want,
        Code:
        gen daysbetween = 22660 - date(CURR_AUDSNC_DATE,"YMD")

        Comment


        • #5
          Thank you very much!

          Comment

          Working...
          X