Computing auditor tenure in Stata
Posted: 29 March 2015 11:55 AM   [ Ignore ]
Newbie
Rank
Total Posts:  19
Joined  2015-02-12

I would need help on calculating auditor tenure in Stata… I’m using Compustat’s “AU” field to identify the auditor, but I am stuck on calculating tenure over time… (so after an auditor switch, the variable tenure should start with 0 again and then always add a year until the next switch…)

Thanks in advance!

Profile
 
 
Posted: 29 March 2015 12:23 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

It looks like you need ‘group’ commands, see:

http://www.stata.com/support/faqs/data-management/creating-variables-recording-properties/
https://www.ssc.wisc.edu/sscc/pubs/sfr-groups.htm
http://stataproject.blogspot.com/2007/12/step-4-thank-god-for-egen-command.html

Best,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 29 March 2015 01:55 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  19
Joined  2015-02-12

Thx for you quick answer Joost - Yes, I agree that group (used by firm and auditor) and sort firm fyear; gen tenure = _n would be a good start here - the problem, though, is that a firm can switch back to the same auditor they had before, but then tenure should start at 0 again… and I’m not sure how to set the count back to 0 within a firm/auditor group

Profile
 
 
Posted: 29 March 2015 02:04 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

I was thinking the ‘minimum’ function by group for a gvkey-au combination. That would still work for missing years, but not for switching back to the same auditor. I don’t know Stata well enough to do this.

Best,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 13 November 2015 09:21 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  8
Joined  2014-12-16

Hi,

I think a way to work around the tenure issue in Stata could be conducted following the steps below:

1. Ensure you have, if not create, an Auditor key (this can be easily created using group command in Stata over auditor name), a company ID and year ID
2. Next ensure you have no duplicate entries in your dataset in terms of GVKEY (use Data > Data utilities > Manage duplicate observations utility in Stata)
3. Declare your data to be a panel, use xtset command (Statistics > Longitudinal/panel data > Setup and utilities > Declare dataset to be panel data utility in Stata)
4. Create lag values of Auditor key, using the L. command in Stata (L1. , L2. .... Ln.).
5. Finally, you compare these keys for your period and create a dummy similar to auditor change, equal to 1 if auditor changed compared to previous year and 0 otherwise.

To my knowledge, auditing literature considers as auditor tenure a relationship between auditor-client for 3-4 years. For this reason you could use the function:

rowtotal (L1.var - L4.var)>0, using the lagged variables you created above. If it is greater than zero, it is a clear indicator of an auditor change the past 4 years (hence use L3.var for 3-years period).

Hope this helps,
Antonis

 Signature 

regards,

Antonis Chantziaras

Profile