Dear Stata Community,
I am very new to econometrics. I wish to examine the impact of X variable on the dummy variable of accounting fraud. If a company has committed accounting fraud in the year 2014--that particular year is coded as fraud year (fraud_year=1 and 0 otherwise). This way I can examine the impact of x on Y(Fraud Dummy). I need your help in:
If I wish to create a dummy variable of pre and post around the fraud event date (fraud_year), how to do that? I am confused because every company has a different year of fraud. This would help me to further investigate the changes in any other variable (For instance Dividends) in the post fraud period. I wish to specify exactly 3 (or 2) years pre and post of that particular event excluding the event year.
Your help is highly appreciated.
Thanks in advance
* Example generated by -dataex-. To install: ssc install dataex
clear
input int(gvkey fyear) float dividends byte fraud_year
1004 1994 7.65 0
1004 1995 7.676 0
1004 1996 7.976 0
1004 1997 9.118 0
1004 1998 9.375 0
1004 1999 9.218 1
1004 2000 9.157 0
1004 2001 4.43 0
1004 2002 .797 0
1004 2003 0 0
1004 2004 0 0
1004 2005 0 0
1004 2006 0 0
1004 2007 0 0
1013 1993 0 0
1013 1994 0 0
1013 1995 0 0
1013 1996 0 0
1013 1997 0 0
1013 1998 0 0
1013 1999 0 0
1013 2000 0 0
1013 2001 0 0
1013 2002 0 0
1013 2003 0 0
1013 2004 0 0
1013 2005 0 1
1013 2006 0 0
1013 2007 0 0
1013 2008 0 0
1034 1993 3.873 0
1034 1994 3.893 0
1034 1995 3.914 0
1034 1996 3.928 0
1034 1997 4.198 0
1034 1998 4.651 0
1034 1999 5.061 0
1034 2000 6.526 0
1034 2001 7.541 0
1034 2002 9.235 0
1034 2003 9.32 1
1034 2004 9.404 0
1034 2005 9.481 0
1034 2006 7.384 0
1034 2007 0 0
1045 1993 60 0
1045 1994 56 0
1045 1995 5 0
1045 1996 0 0
1045 1997 0 0
1045 1998 0 0
1045 1999 0 0
1045 2000 0 1
1045 2001 0 0
1045 2002 0 0
1045 2003 0 0
1045 2004 0 0
1045 2005 0 0
1045 2006 0 0
1045 2007 0 0
1045 2008 0 0
1055 1993 0 0
1055 1994 0 0
1055 1995 0 0
1055 1996 0 0
1056 1999 0 0
1056 2000 0 0
1056 2001 0 0
1056 2002 0 0
1056 2003 0 0
1056 2004 0 0
1056 2005 0 1
1056 2006 0 0
1072 2000 24.463 0
1072 2001 26.201 0
1072 2002 26.146 0
1072 2003 26.048 0
1072 2004 26.022 0
1072 2005 25.862 1
1072 2006 25.819 0
1072 2007 27.466 0
1076 1998 .837 0
1076 1999 .8 0
1076 2000 .792 0
1076 2001 .797 0
1076 2002 .833 0
1076 2003 1.09 0
1076 2004 1.954 0
1076 2005 2.693 0
1076 2006 3.021 1
1076 2007 3.307 0
1078 1993 562.344 0
1078 1994 615.271 0
1078 1995 666.406 0
1078 1996 748.659 0
1078 1997 825.138 0
1078 1998 917.611 0
1078 1999 1038.895 0
1078 2000 1176.694 0
1078 2001 1303.534 0
Related Posts with Codes for Pre-and-Post firm years
Adding gap years in the observationsHello everyone, I have three variables in my dataset - company name, year, and profit. The year var…
How generate terrain ruggedness, elevation over sea level and distance to points of interest?Hi, I am new in Stata. I don't find codes to generate terrain ruggedness, elevation over sea level a…
Export variance covariance matrix to csv fileFor example, sysuse auto, clear I want to export the variance - covariance of variable price mpg h…
Oaxaca with instrumental variableDear all, I am trying to use an Oaxaca- Blinder decomposition to see if a variable of interest cont…
calculate score in StataHello, I gave variables like this: Array Which means: 0. Not using 1. Pill 2. IUD 3. Inje…
Subscribe to:
Post Comments (Atom)
0 Response to Codes for Pre-and-Post firm years
Post a Comment