Hi, I have a panel data (large n and small T) with -id- as the panel variable and -year- as the time variable. The year variable ranges from 2000-2003 and id captures the number of firms.
In addition to this, I have sales value for each of the firm. It is an unbalanced panel.
Just a snippet of how it looks (I have around 20,000 firms):
--id-- --year-- --sales
1 2000 43,722
2 2000 32,000
2 2001 16,000
3 2000 20,001
3 2001 22,768
3 2002 26,890
3 2003 21,760
Now, I have another dataset (dta.file) which has CPI deflator values by year i.e. from 2000-2003.
In order to get sales (in real terms), for example, for firm 1, I have to divide the sales by the 2000 deflator value and multiply by 100. While, I can do this manually, I am looking for a code to first add the deflator using some code and then generating the real sales.
How to proceed?
In addition to this, I have sales value for each of the firm. It is an unbalanced panel.
Just a snippet of how it looks (I have around 20,000 firms):
--id-- --year-- --sales
1 2000 43,722
2 2000 32,000
2 2001 16,000
3 2000 20,001
3 2001 22,768
3 2002 26,890
3 2003 21,760
Now, I have another dataset (dta.file) which has CPI deflator values by year i.e. from 2000-2003.
In order to get sales (in real terms), for example, for firm 1, I have to divide the sales by the 2000 deflator value and multiply by 100. While, I can do this manually, I am looking for a code to first add the deflator using some code and then generating the real sales.
How to proceed?
Comment