I need help with the following problem:
In my dataset I have multiple observations of companies (firm_name) over time (fyear). These describe deals with start-ups those companies closed. Also indicated is the year the start-up went public (ipoyear). This however, does not necessarily have to be the case for all start-ups. Finally, from this I calculated the number of IPOs every company (not start-up) experienced per year (ipos), referring to the IPO year.
For further analysis, I would like to assign the number of IPOs a company realizes per year to the corresponding fyear. This is necessary because all other variables I need in my analysis are assigned to the fyear. For example, 3COM Ventures realized 3 IPOs in 2003. These three startups were invested in 1999 (2 of them) and 2001 (1 of them). However, the 3 IPOs should now show up in fyear 2003, not in the years in which the ventures were invested in.
Is there any code that can get this job done for me? I am looking forward to your comments! Stata Version is 16.1.
Thanks a lot
Robin Zürn
See exemplary data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str60 firm_name int(fyear ipoyear) float ipos "3Com Ventures" 1996 1998 2 "3Com Ventures" 1997 1998 2 "3Com Ventures" 1997 1999 1 "3Com Ventures" 1997 . . "3Com Ventures" 1998 2000 6 "3Com Ventures" 1998 2000 6 "3Com Ventures" 1998 . . "3Com Ventures" 1999 2000 6 "3Com Ventures" 1999 2000 6 "3Com Ventures" 1999 2000 6 "3Com Ventures" 1999 2003 3 "3Com Ventures" 1999 2003 3 "3Com Ventures" 1999 2010 3 "3Com Ventures" 1999 . . "3Com Ventures" 2000 2000 6 "3Com Ventures" 2000 2001 2 "3Com Ventures" 2000 2001 2 "3Com Ventures" 2000 2002 1 "3Com Ventures" 2000 2004 2 "3Com Ventures" 2000 2008 4 "3Com Ventures" 2000 2008 4 "3Com Ventures" 2000 2010 3 "3Com Ventures" 2000 2010 3 "3Com Ventures" 2000 2011 2 "3Com Ventures" 2000 2011 2 "3Com Ventures" 2000 2013 1 "3Com Ventures" 2000 2014 2 "3Com Ventures" 2000 2014 2 "3Com Ventures" 2001 2003 3 "3Com Ventures" 2001 2008 4 "3Com Ventures" 2001 . . "3Com Ventures" 2002 2004 2 "3Com Ventures" 2002 2008 4 "3Com Ventures" 2002 . . "3Com Ventures" 2003 . . end
0 Response to Assign observations in one year to a different year
Post a Comment