Dear,
For my thesis i am running a difference-in-difference design for Danish mandatory joint audits and other Scandinavian countries. Mandatory joint audit were mandatory till 2005. Every year before 2005 is the pre time period and after the post time period. Denmark is the treatment country and the others are control countries. My data consists of financial data (annual) between 2003-2007. I want to estimate discretinary accruals using the modified jones model as a proxy for audit quality. However, instead of using industry SIC codes, i would like to use size-based peer groups based on lagged assets. I would like to create 4 or 5 peer groups per country per year. But i don't know how to do that.
Data sample:
gvkey fyear fyr datadate act at ibc oancf ppegt rect sale exchg nicon conm fic sich sic lagta tacc drev inverse_a ppe sic2 sic2id count
245671 2003 12 31dec2003 54.802 323.588 20.136 16.276 1.469 5.167 15.87 256 20.136 STRAX AB SWE 6799 . 193.837 .0199136 .8803685 .005159 .0075785 . 1 1
245671 2004 12 31dec2004 118.071 453.35 45.738 2.301 2.193 26.305 0 256 45.738 STRAX AB SWE 6799 . 323.588 .1342355 -.1143676 .0030903 .0067771 . 2 1
245671 2005 12 31dec2005 26.61 839.2569999999999 220.88 -8.16 2.66 22.228 249.311 256 220.88 STRAX AB SWE 6799 . 453.35 .5052167 .5589235 .0022058 .0058674 . 3 1
245671 2006 12 31dec2006 337.128 724.196 -114.222 -37.13 2.763 35.446 -83.185 256 -108.195 STRAX AB SWE 6799 . 839.257 -.0918574 -.4119286 .0011915 .0032922 . 4 1
245671 2007 12 31dec2007 27.516 479.667 4.669 6.807 2.231 8.57 13.75 256 -5.679 STRAX AB SWE 6799 . 724.196 -.0029522 .1709634 .0013808 .0030807 . 5 1
270642 2003 12 31dec2003 .174 22.782 -4.124 -1.289 22.589 .106 0 256 -4.124 LAPPLAND GOLDMINERS AB SWE 1040 20.936 -.1354127 -.0014329 .0477646 1.078955 10 6 5
226746 2003 12 31dec2003 36.73 151.907 -10.808 -9.193 115.525 1.399 0 256 -10.102 RIDDARHYTTAN RESOURCES AB SWE 1000 1000 139.881 -.0115455 .0033743 .0071489 .8258806 10 6 5
234244 2003 12 31dec2003 31.106 164.072 60.674 85.139 129.795 1.309 276.757 256 43.713 NORTH ATLANTIC NAT RES AB SWE 1000 1000 195.342 -.1252419 .8772922 .0051192 .66445 10 6 5
220558 2003 12 31dec2003 5434 12337 975 1226 16870 1408 7466 1 688 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 11683 -.0214842 .1421724 .0000856 1.443978 10 6 5
217168 2003 12 31dec2003 14.565 229.732 -8.568 -4.11 219.773 5.128 1.064 256 -9.361000000000001 SCANMINING AB SWE 1000 1000 164.612 -.0270819 -.0344811 .0060749 1.335097 10 6 5
234244 2004 12 31dec2004 78.67100000000001 181.225 35.818 67.243 130.231 1.405 250.219 256 25.755 NORTH ATLANTIC NAT RES AB SWE 1000 1000 164.072 -.1915318 -.1623312 .0060949 .793743 10 7 6
270853 2004 12 31dec2004 2.702 10.876 -3.372 -.465 5.161 .464 .304 305 -3.372 SOTKAMO SILVER AB SWE 1040 2.806 -1.035994 -.2205987 .3563792 1.839273 10 7 6
220558 2004 12 31dec2004 6911 13641 2010 2855 17129 1304 8988 1 1555 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 12337 -.0684932 .1317987 .0000811 1.388425 10 7 6
217168 2004 12 31dec2004 37.428 277.983 -.357 29.463 261.602 3.702 91.485 256 -.8100000000000001 SCANMINING AB SWE 1000 1000 229.732 -.1298034 .3998007 .0043529 1.138727 10 7 6
226746 2004 12 31dec2004 66.494 202.806 -9.776999999999999 -8.054 136.779 8.206 0 256 -9.4 RIDDARHYTTAN RESOURCES AB SWE 1000 1000 151.907 -.0113425 -.0448103 .006583 .9004127 10 7 6
270642 2004 12 31dec2004 9.250999999999999 59.294 -7.955 -12.716 .186 1.583 1.775 256 -7.955 LAPPLAND GOLDMINERS AB SWE 1040 22.782 .2089808 .0130805 .0438943 .0081643 10 7 6
270853 2005 12 31dec2005 5.044 18.974 -4.072 -5.5 5.243 .986 .071 305 -4.072 SOTKAMO SILVER AB SWE 1040 1040 10.876 .1312983 -.0694189 .0919456 .4820706 10 8 7
270642 2005 12 31dec2005 14.201 81.498 -13.309 -11.679 .588 2.656 2.823 256 -13.309 LAPPLAND GOLDMINERS AB SWE 1040 1040 59.294 -.0274901 -.0004216 .0168651 .0099167 10 8 7
220558 2005 12 31dec2005 10776 20574 6451 5520 20898 2193 14337 1 4546 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 13641 .0682501 .3269555 .0000733 1.531999 10 8 7
285740 2005 12 31dec2005 36.696 139.039 4.019 -9.147 44.063 8.827 19.274 256 4.019 AURIANT MINING AB SWE 1040 1040 56.764 .2319428 .1692798 .0176168 .7762491 10 8 7
285053 2005 12 31dec2005 1.212 4.234 -2.307 -1.817 .046 .273 0 194 -2.307 AHTIUM OYJ FIN 1000 1000 2.573 -.1904392 -.0555771 .3886514 .017878 10 8 7
217168 2005 12 31dec2005 92.352 497.405 -18.363 -19.543 249.754 49.155 113.276 256 -18.363 SCANMINING AB SWE 1000 1000 277.983 .0042449 -.0851203 .0035973 .8984506 10 8 7
288972 2005 12 31dec2005 53.345 79.79600000000001 -12.937 -3.883 2.92 .047 9.295999999999999 144 -12.937 NUNAMINERALS A/S DNK 1000 1000 50.902 -.1778712 .1256336 .0196456 .0573651 10 8 7
217168 2006 12 31dec2006 104.753 780.466 -65.93899999999999 38.866 537.931 41.687 169.083 256 -65.93899999999999 SCANMINING AB SWE 1000 497.405 -.2107036 .1272102 .0020104 1.081475 10 9 9
285053 2006 12 31dec2006 30.055 39.75 -37.653 -2.286 4.942 .553 0 194 -37.653 AHTIUM OYJ FIN 1000 1000 4.234 -8.353093 -.0661313 .2361833 1.167218 10 9 9
270642 2006 12 31dec2006 51.77 161.549 -15.978 -.072 14.221 1.989 1.904 256 -15.978 LAPPLAND GOLDMINERS AB SWE 1040 1040 81.498 -.1951704 -.0030921 .0122702 .1744951 10 9 9
282436 2006 12 31dec2006 61.508 157.248 -2.44 -.454 1.324 3.94 0 256 -2.44 NORDIC MINES AB SWE 1040 1040 39.293 -.0505434 -.0614613 .0254498 .0336956 10 9 9
284729 2006 12 31dec2006 10.165 16.226 -2.63 -2.104 .118 .5 0 228 DANNEMORA MINERAL AB SWE 1000 1000 1.23 -.4276423 .4902439 .8130081 .095935 10 9 9
270853 2006 12 31dec2006 24.252 48.337 -9.551 -7.168 11.909 2.404 0 305 -9.551 SOTKAMO SILVER AB SWE 1040 1040 18.974 -.1255929 -.0784758 .0527037 .6276484 10 9 9
288972 2006 12 31dec2006 12.007 76.798 -3.467 -2.782 21.419 .527 18.684 144 -3.467 NUNAMINERALS A/S DNK 1000 1000 79.796 -.0085844 .1116347 .012532 .268422 10 9 9
220558 2006 12 31dec2006 11524 25865 4597 6046 25617 2332 14615 1 4597 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 20574 -.0704287 .0067561 .0000486 1.245115 10 9 9
285740 2006 12 31dec2006 209.79 459.023 -14.798 4.83 90.497 98.355 74.065 256 -14.798 AURIANT MINING AB SWE 1040 1040 139.039 -.141169 -.2498364 .0071922 .6508749 10 9 9
285064 2007 12 31dec2007 72.38500000000001 232.737 -6.559 -4.809 3.462 3.24 0 256 -6.559 ENDOMINES AB SWE 1040 1040 148.923 -.011751 -.0145579 .0067149 .0232469 10 10 10
285053 2007 12 31dec2007 165.598 350.05 -9.384 -27.623 139.533 9.407999999999999 0 194 -9.384 AHTIUM OYJ FIN 1000 1000 39.75 .4588428 -.2227673 .0251572 3.510264 10 10 10
288972 2007 12 31dec2007 8.587 89.67 11.197 -.175 25.019 2.829 3.971 144 11.197 NUNAMINERALS A/S DNK 1000 1000 76.798 .1480768 -.2215553 .0130212 .3257767 10 10 10
I've already calculated lagged total assets in variable: lagta. I know i still need to create the PRE- and POST variable as well as Treatement and Control variable.
Could somebody tell me how to create size-based peer groups per country?
For my thesis i am running a difference-in-difference design for Danish mandatory joint audits and other Scandinavian countries. Mandatory joint audit were mandatory till 2005. Every year before 2005 is the pre time period and after the post time period. Denmark is the treatment country and the others are control countries. My data consists of financial data (annual) between 2003-2007. I want to estimate discretinary accruals using the modified jones model as a proxy for audit quality. However, instead of using industry SIC codes, i would like to use size-based peer groups based on lagged assets. I would like to create 4 or 5 peer groups per country per year. But i don't know how to do that.
Data sample:
gvkey fyear fyr datadate act at ibc oancf ppegt rect sale exchg nicon conm fic sich sic lagta tacc drev inverse_a ppe sic2 sic2id count
245671 2003 12 31dec2003 54.802 323.588 20.136 16.276 1.469 5.167 15.87 256 20.136 STRAX AB SWE 6799 . 193.837 .0199136 .8803685 .005159 .0075785 . 1 1
245671 2004 12 31dec2004 118.071 453.35 45.738 2.301 2.193 26.305 0 256 45.738 STRAX AB SWE 6799 . 323.588 .1342355 -.1143676 .0030903 .0067771 . 2 1
245671 2005 12 31dec2005 26.61 839.2569999999999 220.88 -8.16 2.66 22.228 249.311 256 220.88 STRAX AB SWE 6799 . 453.35 .5052167 .5589235 .0022058 .0058674 . 3 1
245671 2006 12 31dec2006 337.128 724.196 -114.222 -37.13 2.763 35.446 -83.185 256 -108.195 STRAX AB SWE 6799 . 839.257 -.0918574 -.4119286 .0011915 .0032922 . 4 1
245671 2007 12 31dec2007 27.516 479.667 4.669 6.807 2.231 8.57 13.75 256 -5.679 STRAX AB SWE 6799 . 724.196 -.0029522 .1709634 .0013808 .0030807 . 5 1
270642 2003 12 31dec2003 .174 22.782 -4.124 -1.289 22.589 .106 0 256 -4.124 LAPPLAND GOLDMINERS AB SWE 1040 20.936 -.1354127 -.0014329 .0477646 1.078955 10 6 5
226746 2003 12 31dec2003 36.73 151.907 -10.808 -9.193 115.525 1.399 0 256 -10.102 RIDDARHYTTAN RESOURCES AB SWE 1000 1000 139.881 -.0115455 .0033743 .0071489 .8258806 10 6 5
234244 2003 12 31dec2003 31.106 164.072 60.674 85.139 129.795 1.309 276.757 256 43.713 NORTH ATLANTIC NAT RES AB SWE 1000 1000 195.342 -.1252419 .8772922 .0051192 .66445 10 6 5
220558 2003 12 31dec2003 5434 12337 975 1226 16870 1408 7466 1 688 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 11683 -.0214842 .1421724 .0000856 1.443978 10 6 5
217168 2003 12 31dec2003 14.565 229.732 -8.568 -4.11 219.773 5.128 1.064 256 -9.361000000000001 SCANMINING AB SWE 1000 1000 164.612 -.0270819 -.0344811 .0060749 1.335097 10 6 5
234244 2004 12 31dec2004 78.67100000000001 181.225 35.818 67.243 130.231 1.405 250.219 256 25.755 NORTH ATLANTIC NAT RES AB SWE 1000 1000 164.072 -.1915318 -.1623312 .0060949 .793743 10 7 6
270853 2004 12 31dec2004 2.702 10.876 -3.372 -.465 5.161 .464 .304 305 -3.372 SOTKAMO SILVER AB SWE 1040 2.806 -1.035994 -.2205987 .3563792 1.839273 10 7 6
220558 2004 12 31dec2004 6911 13641 2010 2855 17129 1304 8988 1 1555 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 12337 -.0684932 .1317987 .0000811 1.388425 10 7 6
217168 2004 12 31dec2004 37.428 277.983 -.357 29.463 261.602 3.702 91.485 256 -.8100000000000001 SCANMINING AB SWE 1000 1000 229.732 -.1298034 .3998007 .0043529 1.138727 10 7 6
226746 2004 12 31dec2004 66.494 202.806 -9.776999999999999 -8.054 136.779 8.206 0 256 -9.4 RIDDARHYTTAN RESOURCES AB SWE 1000 1000 151.907 -.0113425 -.0448103 .006583 .9004127 10 7 6
270642 2004 12 31dec2004 9.250999999999999 59.294 -7.955 -12.716 .186 1.583 1.775 256 -7.955 LAPPLAND GOLDMINERS AB SWE 1040 22.782 .2089808 .0130805 .0438943 .0081643 10 7 6
270853 2005 12 31dec2005 5.044 18.974 -4.072 -5.5 5.243 .986 .071 305 -4.072 SOTKAMO SILVER AB SWE 1040 1040 10.876 .1312983 -.0694189 .0919456 .4820706 10 8 7
270642 2005 12 31dec2005 14.201 81.498 -13.309 -11.679 .588 2.656 2.823 256 -13.309 LAPPLAND GOLDMINERS AB SWE 1040 1040 59.294 -.0274901 -.0004216 .0168651 .0099167 10 8 7
220558 2005 12 31dec2005 10776 20574 6451 5520 20898 2193 14337 1 4546 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 13641 .0682501 .3269555 .0000733 1.531999 10 8 7
285740 2005 12 31dec2005 36.696 139.039 4.019 -9.147 44.063 8.827 19.274 256 4.019 AURIANT MINING AB SWE 1040 1040 56.764 .2319428 .1692798 .0176168 .7762491 10 8 7
285053 2005 12 31dec2005 1.212 4.234 -2.307 -1.817 .046 .273 0 194 -2.307 AHTIUM OYJ FIN 1000 1000 2.573 -.1904392 -.0555771 .3886514 .017878 10 8 7
217168 2005 12 31dec2005 92.352 497.405 -18.363 -19.543 249.754 49.155 113.276 256 -18.363 SCANMINING AB SWE 1000 1000 277.983 .0042449 -.0851203 .0035973 .8984506 10 8 7
288972 2005 12 31dec2005 53.345 79.79600000000001 -12.937 -3.883 2.92 .047 9.295999999999999 144 -12.937 NUNAMINERALS A/S DNK 1000 1000 50.902 -.1778712 .1256336 .0196456 .0573651 10 8 7
217168 2006 12 31dec2006 104.753 780.466 -65.93899999999999 38.866 537.931 41.687 169.083 256 -65.93899999999999 SCANMINING AB SWE 1000 497.405 -.2107036 .1272102 .0020104 1.081475 10 9 9
285053 2006 12 31dec2006 30.055 39.75 -37.653 -2.286 4.942 .553 0 194 -37.653 AHTIUM OYJ FIN 1000 1000 4.234 -8.353093 -.0661313 .2361833 1.167218 10 9 9
270642 2006 12 31dec2006 51.77 161.549 -15.978 -.072 14.221 1.989 1.904 256 -15.978 LAPPLAND GOLDMINERS AB SWE 1040 1040 81.498 -.1951704 -.0030921 .0122702 .1744951 10 9 9
282436 2006 12 31dec2006 61.508 157.248 -2.44 -.454 1.324 3.94 0 256 -2.44 NORDIC MINES AB SWE 1040 1040 39.293 -.0505434 -.0614613 .0254498 .0336956 10 9 9
284729 2006 12 31dec2006 10.165 16.226 -2.63 -2.104 .118 .5 0 228 DANNEMORA MINERAL AB SWE 1000 1000 1.23 -.4276423 .4902439 .8130081 .095935 10 9 9
270853 2006 12 31dec2006 24.252 48.337 -9.551 -7.168 11.909 2.404 0 305 -9.551 SOTKAMO SILVER AB SWE 1040 1040 18.974 -.1255929 -.0784758 .0527037 .6276484 10 9 9
288972 2006 12 31dec2006 12.007 76.798 -3.467 -2.782 21.419 .527 18.684 144 -3.467 NUNAMINERALS A/S DNK 1000 1000 79.796 -.0085844 .1116347 .012532 .268422 10 9 9
220558 2006 12 31dec2006 11524 25865 4597 6046 25617 2332 14615 1 4597 LKAB-LUOSSAVAARA KIIRUNAVAAR SWE 1000 1000 20574 -.0704287 .0067561 .0000486 1.245115 10 9 9
285740 2006 12 31dec2006 209.79 459.023 -14.798 4.83 90.497 98.355 74.065 256 -14.798 AURIANT MINING AB SWE 1040 1040 139.039 -.141169 -.2498364 .0071922 .6508749 10 9 9
285064 2007 12 31dec2007 72.38500000000001 232.737 -6.559 -4.809 3.462 3.24 0 256 -6.559 ENDOMINES AB SWE 1040 1040 148.923 -.011751 -.0145579 .0067149 .0232469 10 10 10
285053 2007 12 31dec2007 165.598 350.05 -9.384 -27.623 139.533 9.407999999999999 0 194 -9.384 AHTIUM OYJ FIN 1000 1000 39.75 .4588428 -.2227673 .0251572 3.510264 10 10 10
288972 2007 12 31dec2007 8.587 89.67 11.197 -.175 25.019 2.829 3.971 144 11.197 NUNAMINERALS A/S DNK 1000 1000 76.798 .1480768 -.2215553 .0130212 .3257767 10 10 10
I've already calculated lagged total assets in variable: lagta. I know i still need to create the PRE- and POST variable as well as Treatement and Control variable.
Could somebody tell me how to create size-based peer groups per country?
Comment