Hello Stata community,
I have a panel dataset consisting of many firms over 22 years. Firms are identified by "DSCD" and each belongs to an Industry " ffi ". Each firm has an observation for a variable " RDTAwt " that is either 0 or >0. I have created an indicator variable "balancedind" that =1 where all data required to run regressions is available in that firm-year. I am interested in firms that have an "RDTAwt" observation that is >0. I would like to match for each of these firm years where RDTAwt > 0, a matched firm where RDTAwt = 0, conditioned on balancedind ==1 for both firms. I would like to match based on the industry " ffi " and firm size, "TA". I require an exact match on ffi (industry) and a match within 20% for TA (size). For example, if a firm has TA of 100 then a matched firm can have 80 <= TA <= 120. I am also wondering if there is a way I can switch between matching with and without replacement so that I can compare the results with both.
Any guidance would be greatly appreciated.
Thanks.
I have a panel dataset consisting of many firms over 22 years. Firms are identified by "DSCD" and each belongs to an Industry " ffi ". Each firm has an observation for a variable " RDTAwt " that is either 0 or >0. I have created an indicator variable "balancedind" that =1 where all data required to run regressions is available in that firm-year. I am interested in firms that have an "RDTAwt" observation that is >0. I would like to match for each of these firm years where RDTAwt > 0, a matched firm where RDTAwt = 0, conditioned on balancedind ==1 for both firms. I would like to match based on the industry " ffi " and firm size, "TA". I require an exact match on ffi (industry) and a match within 20% for TA (size). For example, if a firm has TA of 100 then a matched firm can have 80 <= TA <= 120. I am also wondering if there is a way I can switch between matching with and without replacement so that I can compare the results with both.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long DSCD int year float(balancedind RDTAwt) double TA float ffi 1 1999 . 0 178392 36 1 2000 . 0 279960 36 1 2001 . 0 376506 36 1 2002 . 0 460890 36 1 2003 . 0 515080 36 1 2004 . 0 592146 36 1 2005 . 0 704957 36 1 2006 . 0 900030 36 1 2007 . 0 1028851 36 1 2008 . 0 1798857 36 1 2009 . 0 1754039 36 1 2010 . 0 1716317 36 1 2011 . .004691441 1708051 36 1 2012 . .013918202 1727560 36 1 2013 . .02107018 1677374 36 1 2014 . .027589554 2103174 36 1 2020 . 0 . 36 1 2021 . 0 . . 1 2015 1 .029417917 1979222 36 1 2016 1 .034052774 2004894 36 1 2017 1 .03758303 2073407 36 1 2018 1 .03764191 2005064 36 1 2019 1 .03967754 2116877 36 2 1999 1 0 1742574 17 2 2000 . 0 1841439 17 2 2021 . 0 . . 2 2001 1 0 2224580 17 2 2002 1 0 2258530 17 2 2003 1 0 2330093 17 2 2004 1 0 2355852 17 2 2005 1 0 2433316 17 2 2006 1 0 2506421 17 2 2007 1 0 2683805 17 2 2008 1 0 3032502 17 2 2009 1 0 3239283 17 2 2010 1 0 3074743 17 2 2011 1 0 3147822 17 2 2012 1 0 3160926 17 2 2013 1 0 3259826 17 2 2014 1 0 7464392 17 2 2015 1 0 6961732 17 2 2016 1 0 7300905 17 2 2017 1 0 8992511 17 2 2018 1 0 9551419 17 2 2019 1 0 10131600 17 2 2020 1 0 10580800 17 3 1999 1 0 80216 21 3 2000 . 0 54030 21 3 2009 . 0 . 21 3 2010 . 0 . 21 3 2011 . 0 . 21 3 2012 . 0 . 21 3 2013 . 0 . 21 3 2014 . 0 . 21 3 2015 . 0 . 21 3 2016 . 0 . 21 3 2017 . 0 . 21 3 2018 . 0 . 21 3 2019 . 0 . 21 3 2020 . 0 . 21 3 2021 . 0 . . 3 2001 1 0 38279 21 3 2002 1 0 36002 21 3 2003 1 0 30346 21 3 2004 1 0 26626 21 3 2005 1 0 26354 21 3 2006 1 0 27188 21 3 2007 1 0 29300 21 3 2008 1 0 21030 21 4 1999 . 0 2280227 24 4 2000 . 0 2162274 24 4 2001 . 0 2025012 24 4 2002 . 0 1887196 24 4 2003 . 0 1838680 24 4 2004 . 0 1933886 24 4 2005 . 0 1839100 24 4 2006 . 0 1962882 24 4 2007 . 0 2079041 24 4 2008 . 0 2090531 24 4 2009 . 0 2252931 24 4 2010 . 0 2363653 24 4 2011 . 0 2569348 24 4 2012 . 0 3122951 24 4 2013 . 0 3685501 24 4 2014 . 0 2453115 24 4 2021 . 0 . . 4 2015 1 0 2319263 24 4 2016 1 0 2685760 24 4 2017 1 0 2858481 24 4 2018 1 0 2780666 24 4 2019 1 0 2860996 24 4 2020 1 0 3728733 24 5 1999 . 0 . . 5 2000 . 0 . . 5 2001 . 0 . . 5 2002 . 0 . . 5 2003 . 0 . . 5 2004 . 0 . . 5 2005 . 0 . . 5 2006 . 0 . . end label values DSCD DSCD1 label def DSCD1 1 "130042", modify label def DSCD1 2 "130062", modify label def DSCD1 3 "130079", modify label def DSCD1 4 "130086", modify label def DSCD1 5 "130088", modify label values ffi ffi label def ffi 17 "Construction Materials", modify label def ffi 21 "Machinery", modify label def ffi 24 "Aircraft", modify label def ffi 36 "Electronic Equipment", modify
Any guidance would be greatly appreciated.
Thanks.
Comment