Hi @novinosrin , I have a follow-up question. Dataset Have3 has a thrid variable called year, which means the year that two companies formed the partnership. Have3 FirmID1 FirmID2 Year 1001 25046 1997 1002 35241 2006 I would like to complete two tasks: 1) count the number of the same products by the year that they formed the partnership; 2) the number calculated in 1) is divided by the total number of products for FirmID2 by the year that they formed the partnership. For example, 1001 and 25046 formed the partnership in 1997. They shared 4 same products (A1, B3, V5, Y8) by 1997. The total number of products for 25064 is 14 by 1997. So the ration is 4/14=0.2857 Can you tell me how to revise the code? Thanks.
... View more