Announcement

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

  • Calculating a tenure proxy

    Hello everyone,
    I want to calculate auditor tenure variable from the following variables: firm id, year, and name auditor. The firms number is more than 3000, number of year is 13 years( 2006-2018).
    I need this variable most for my revision. Please I need help.
    commands

  • #2
    Alkebsee:
    as you know, scant details produce at best tentative replies, like the following toy-example (where idcode=firm and smp=auditor):
    Code:
    . use "https://www.stata-press.com/data/r16/nlswork.dta"
    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
    
    . bysort idcode msp : egen wanted=total(tenure)
    
    
    . list idcode msp wanted if idcode==1
    
           +-------------------------+
           | idcode   msp     wanted |
           |-------------------------|
        1. |      1     0   15.33333 |
        2. |      1     0   15.33333 |
        3. |      1     0   15.33333 |
        4. |      1     0   15.33333 |
        5. |      1     0   15.33333 |
           |-------------------------|
        6. |      1     0   15.33333 |
        7. |      1     0   15.33333 |
        8. |      1     0   15.33333 |
        9. |      1     1       1.25 |
       10. |      1     1       1.25 |
           |-------------------------|
       11. |      1     1       1.25 |
       12. |      1     1       1.25 |
           +-------------------------+
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Alkebsee:
      as you know, scant details produce at best tentative replies, like the following toy-example (where idcode=firm and smp=auditor):
      Code:
      . use "https://www.stata-press.com/data/r16/nlswork.dta"
      (National Longitudinal Survey. Young Women 14-26 years of age in 1968)
      
      . bysort idcode msp : egen wanted=total(tenure)
      
      
      . list idcode msp wanted if idcode==1
      
      +-------------------------+
      | idcode msp wanted |
      |-------------------------|
      1. | 1 0 15.33333 |
      2. | 1 0 15.33333 |
      3. | 1 0 15.33333 |
      4. | 1 0 15.33333 |
      5. | 1 0 15.33333 |
      |-------------------------|
      6. | 1 0 15.33333 |
      7. | 1 0 15.33333 |
      8. | 1 0 15.33333 |
      9. | 1 1 1.25 |
      10. | 1 1 1.25 |
      |-------------------------|
      11. | 1 1 1.25 |
      12. | 1 1 1.25 |
      +-------------------------+
      
      .
      thank you so much carlo alberto
      Actually you are right about the scant details.
      I found that you use msp for auditor but your values of the mps are numeric. while in my data is Character "name of the auditor. So, does this command works with a numeric data? if yes can you explain to to use.
      kindest,
      Radwan

      Comment


      • #4
        Originally posted by Carlo Lazzaro View Post
        Alkebsee:
        as you know, scant details produce at best tentative replies, like the following toy-example (where idcode=firm and smp=auditor):
        Code:
        . use "https://www.stata-press.com/data/r16/nlswork.dta"
        (National Longitudinal Survey. Young Women 14-26 years of age in 1968)
        
        . bysort idcode msp : egen wanted=total(tenure)
        
        
        . list idcode msp wanted if idcode==1
        
        +-------------------------+
        | idcode msp wanted |
        |-------------------------|
        1. | 1 0 15.33333 |
        2. | 1 0 15.33333 |
        3. | 1 0 15.33333 |
        4. | 1 0 15.33333 |
        5. | 1 0 15.33333 |
        |-------------------------|
        6. | 1 0 15.33333 |
        7. | 1 0 15.33333 |
        8. | 1 0 15.33333 |
        9. | 1 1 1.25 |
        10. | 1 1 1.25 |
        |-------------------------|
        11. | 1 1 1.25 |
        12. | 1 1 1.25 |
        +-------------------------+
        
        .
        Thank you sooooooooooooooooooooo much it is done.

        Comment


        • #5
          Alkebsee:
          Carlo Alberto (https://en.wikipedia.org/wiki/Charle...rt_of_Sardinia) is a bit of a stretch!
          Carlo is enough, thanks.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Originally posted by Carlo Lazzaro View Post
            Alkebsee:
            Carlo Alberto (https://en.wikipedia.org/wiki/Charle...rt_of_Sardinia) is a bit of a stretch!
            Carlo is enough, thanks.
            Very sorry for the mistake dear Carlo Lazzaro.

            Comment


            • #7
              Alkebse:
              you've nothing to apologize about.
              I was just kidding myself and trying to disseminate some Italian history-based fun!
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X