Dear all,
My data structure is acqcusip targetcusip dealnumber Yrannounced dateannounced acqnation targetnation,
first, acqcusip indicates the code of the acquirer company,
second, targetcusip indicates the code of the target company,
third, dealnumber represents the transaction code,
fourth, Yrannounced represents the acquisition year,
next, dateannounced represents the specific acquisition time, and acqnation represents the acquirer's country code and targetnation represents the target's country code.
Note: Each acquirer may have multiple acquisitions in the same year.
I want to calculate two variables: first, the number of international acquisitions in the three years before each acquisition by the acquirer company (acq prior 3 years' international acquisitions experience), provided that the country of the host country is excluded for the international acquisitions in the first three years. International acquisition refers to all international acquisition except the current acquisition of acqnation and targetnation, to avoid double calculation with the next variable.
second, acq prior 3 years' host-country acquisition experience (acq prior 3 years' host-country acquisition experience), that is, the number of acquisitions in the host country in the three years before this acquisition.
for example, in my following sample, "1830804040" "00011X" "81646E" "01/17/2007" 2007 "AU" "NZ", 00011X 81646E prior 3 years' international acquisitions experience=0 in 2007 (host country's international acquisitions do not count as the targetnation is NZ, So the previous NZ in 2005 and 2006 do not count), prior 3 years' host-country acquisition experience=3; 00011X 1C8854 prior 3 years' international acquisitions experience=2 in 2014 (two NZ acquisitions in 2011), prior 3 years' host-country acquisition experience=0 (No HK acquisition in 2011, 2012, 2013)
Sorry for the long intro. I hope the explanation is clear. Your help is appreciated.
With kind regards,
Zhidi
* Example generated by -dataex-. For more info, type help dataex
clear
input str12 dealnumber str9(acqcusip targetcusip) str10 dateannounced int Yrannounced str6(acqnation targetnation)
"1348548040" "00008W" "00263H" "10/01/2002" 2002 "AU" "AU"
"1531438040" "00008W" "28382W" "06/01/2004" 2004 "AU" "AU"
"1705049040" "00008W" "67186L" "10/27/2005" 2005 "AU" "AU"
"1718617040" "00008W" "04537E" "12/09/2005" 2005 "AU" "AU"
"1717549040" "00008W" "00609R" "12/06/2005" 2005 "AU" "AU"
"1726593040" "00008W" "89267Z" "01/10/2006" 2006 "AU" "AU"
"1912635040" "00008W" "25559E" "10/08/2007" 2007 "AU" "AU"
"1912631040" "00008W" "78855W" "10/08/2007" 2007 "AU" "AU"
"1894440040" "00008W" "87021Z" "07/31/2007" 2007 "AU" "AU"
"1912621040" "00008W" "90642K" "10/08/2007" 2007 "AU" "AU"
"2532169040" "00008W" "4A5478" "06/24/2013" 2013 "AU" "AU"
"3493667040" "00008W" "9J2790" "11/22/19" 2019 "AU" "AU"
"3480562040" "00008W" "8J3265" "11/22/19" 2019 "AU" "AU"
"1335110020" "00009A" "46164W" "10/14/2002" 2002 "AU" "US"
"1350608040" "00009C" "36835E" "12/09/2002" 2002 "NT" "CT"
"1696179040" "00009T" "36061P" "09/22/2005" 2005 "JP" "JP"
"770037040" "00009Z" "30281F" "04/21/1998" 1998 "AS" "IT"
"1888935040" "00010J" "85535Z" "07/17/2007" 2007 "TH" "TH"
"1953367040" "00010J" "85535Z" "02/18/2008" 2008 "TH" "TH"
"1321040040" "00010L" "92644Y" "06/19/2002" 2002 "FR" "FR"
"574898040" "00010P" "89051E" "07/19/1995" 1995 "EA" "EA"
"1306015040" "00011R" "74083V" "01/23/2002" 2002 "UK" "UK"
"2258414040" "00011X" "54342E" "03/01/2005" 2005 "AU" "NZ"
"1799617040" "00011X" "31711X" "10/06/2006" 2006 "AU" "NZ"
"1743696040" "00011X" "86285Z" "03/15/2006" 2006 "AU" "NZ"
"1830804040" "00011X" "81646E" "01/17/2007" 2007 "AU" "NZ"
"1884842040" "00011X" "89044Z" "07/03/2007" 2007 "AU" "AU"
"1938101040" "00011X" "83124L" "12/20/2007" 2007 "AU" "NZ"
"2337902040" "00011X" "07360H" "08/18/2011" 2011 "AU" "NZ"
"2287077040" "00011X" "67671N" "03/05/2011" 2011 "AU" "NZ"
"2388325040" "00011X" "67235H" "11/08/2011" 2011 "AU" "AU"
"2426573040" "00011X" "10540K" "06/21/2012" 2012 "AU" "AU"
"2610863040" "00011X" "05291M" "02/19/2014" 2014 "AU" "AU"
"2709021040" "00011X" "4C9990" "12/22/2014" 2014 "AU" "AU"
"2657268040" "00011X" "1C8854" "07/18/2014" 2014 "AU" "HK"
"3024640040" "00011X" "2F0519" "10/24/2016" 2016 "AU" "AU"
end
My data structure is acqcusip targetcusip dealnumber Yrannounced dateannounced acqnation targetnation,
first, acqcusip indicates the code of the acquirer company,
second, targetcusip indicates the code of the target company,
third, dealnumber represents the transaction code,
fourth, Yrannounced represents the acquisition year,
next, dateannounced represents the specific acquisition time, and acqnation represents the acquirer's country code and targetnation represents the target's country code.
Note: Each acquirer may have multiple acquisitions in the same year.
I want to calculate two variables: first, the number of international acquisitions in the three years before each acquisition by the acquirer company (acq prior 3 years' international acquisitions experience), provided that the country of the host country is excluded for the international acquisitions in the first three years. International acquisition refers to all international acquisition except the current acquisition of acqnation and targetnation, to avoid double calculation with the next variable.
second, acq prior 3 years' host-country acquisition experience (acq prior 3 years' host-country acquisition experience), that is, the number of acquisitions in the host country in the three years before this acquisition.
for example, in my following sample, "1830804040" "00011X" "81646E" "01/17/2007" 2007 "AU" "NZ", 00011X 81646E prior 3 years' international acquisitions experience=0 in 2007 (host country's international acquisitions do not count as the targetnation is NZ, So the previous NZ in 2005 and 2006 do not count), prior 3 years' host-country acquisition experience=3; 00011X 1C8854 prior 3 years' international acquisitions experience=2 in 2014 (two NZ acquisitions in 2011), prior 3 years' host-country acquisition experience=0 (No HK acquisition in 2011, 2012, 2013)
Sorry for the long intro. I hope the explanation is clear. Your help is appreciated.
With kind regards,
Zhidi
* Example generated by -dataex-. For more info, type help dataex
clear
input str12 dealnumber str9(acqcusip targetcusip) str10 dateannounced int Yrannounced str6(acqnation targetnation)
"1348548040" "00008W" "00263H" "10/01/2002" 2002 "AU" "AU"
"1531438040" "00008W" "28382W" "06/01/2004" 2004 "AU" "AU"
"1705049040" "00008W" "67186L" "10/27/2005" 2005 "AU" "AU"
"1718617040" "00008W" "04537E" "12/09/2005" 2005 "AU" "AU"
"1717549040" "00008W" "00609R" "12/06/2005" 2005 "AU" "AU"
"1726593040" "00008W" "89267Z" "01/10/2006" 2006 "AU" "AU"
"1912635040" "00008W" "25559E" "10/08/2007" 2007 "AU" "AU"
"1912631040" "00008W" "78855W" "10/08/2007" 2007 "AU" "AU"
"1894440040" "00008W" "87021Z" "07/31/2007" 2007 "AU" "AU"
"1912621040" "00008W" "90642K" "10/08/2007" 2007 "AU" "AU"
"2532169040" "00008W" "4A5478" "06/24/2013" 2013 "AU" "AU"
"3493667040" "00008W" "9J2790" "11/22/19" 2019 "AU" "AU"
"3480562040" "00008W" "8J3265" "11/22/19" 2019 "AU" "AU"
"1335110020" "00009A" "46164W" "10/14/2002" 2002 "AU" "US"
"1350608040" "00009C" "36835E" "12/09/2002" 2002 "NT" "CT"
"1696179040" "00009T" "36061P" "09/22/2005" 2005 "JP" "JP"
"770037040" "00009Z" "30281F" "04/21/1998" 1998 "AS" "IT"
"1888935040" "00010J" "85535Z" "07/17/2007" 2007 "TH" "TH"
"1953367040" "00010J" "85535Z" "02/18/2008" 2008 "TH" "TH"
"1321040040" "00010L" "92644Y" "06/19/2002" 2002 "FR" "FR"
"574898040" "00010P" "89051E" "07/19/1995" 1995 "EA" "EA"
"1306015040" "00011R" "74083V" "01/23/2002" 2002 "UK" "UK"
"2258414040" "00011X" "54342E" "03/01/2005" 2005 "AU" "NZ"
"1799617040" "00011X" "31711X" "10/06/2006" 2006 "AU" "NZ"
"1743696040" "00011X" "86285Z" "03/15/2006" 2006 "AU" "NZ"
"1830804040" "00011X" "81646E" "01/17/2007" 2007 "AU" "NZ"
"1884842040" "00011X" "89044Z" "07/03/2007" 2007 "AU" "AU"
"1938101040" "00011X" "83124L" "12/20/2007" 2007 "AU" "NZ"
"2337902040" "00011X" "07360H" "08/18/2011" 2011 "AU" "NZ"
"2287077040" "00011X" "67671N" "03/05/2011" 2011 "AU" "NZ"
"2388325040" "00011X" "67235H" "11/08/2011" 2011 "AU" "AU"
"2426573040" "00011X" "10540K" "06/21/2012" 2012 "AU" "AU"
"2610863040" "00011X" "05291M" "02/19/2014" 2014 "AU" "AU"
"2709021040" "00011X" "4C9990" "12/22/2014" 2014 "AU" "AU"
"2657268040" "00011X" "1C8854" "07/18/2014" 2014 "AU" "HK"
"3024640040" "00011X" "2F0519" "10/24/2016" 2016 "AU" "AU"
end
Comment