Dear Stata Forumers,
I want to make a variable called experience, which counts all the previous investments made in the "company group" that came before the first_investment_date of a particular observation. In addition, experience should only be counted if the investment_amount per firm is unique.
Thank you in advance for your help!
Ben James
*--------------------------start_inputs-----------*
clear all
input company fund investment_amount investment_date first_investment_date
1 1 2000 10 2000
1 2 2001 9 2001
1 2 2002 8 2001
2 1 2003 4 2003
2 1 2004 3 2003
3 1 2003 12 2003
3 3 2004 14 2004
4 1 2000 15 2000
4 2 2000 6 2000
end
*--------------------------end_inputs-----------*
*--------------------------start_desired_outcome-----------*
clear all
input company fund investment_date investment_amount first_investment_date experience
1 1 2000 10 2000 0
1 2 2001 9 2001 1
1 2 2002 8 2001 1
2 1 2003 4 2003 0
2 1 2004 3 2003 0
3 1 2003 12 2003 0
3 3 2004 14 2004 1
4 1 2000 15 2000 0
4 2 2000 6 2000 0
end
*--------------------------end_desired_outcome-----------*
Comment