For year 2008, compare it with 2009. I have common firms: C, D. then I calculate C,D's mean (z+m)/2 for year 2008.
For year 2009, compare it with 2010. I have common firms: C, F. then I calculate C, F's mean (n+w)/2 for year 2009.
For year 2010, compare it with 2011. I have common firms: F, G. then i calculate F, G's mean (r+v)/2 for year 2010.
I understand this is a rather simple algorithm, but i didnt find a good way to do it in stata. Hope you could help. Many thanks.
| year | firm id | variable of interest |
| 2008 | A | x |
| 2008 | B | y |
| 2008 | C | z |
| 2008 | D | m |
| 2009 | C | n |
| 2009 | D | q |
| 2009 | F | w |
| 2010 | C | t |
| 2010 | F | r |
| 2010 | G | v |
| 2011 | F | u |
| 2011 | G | p |
| 2011 | H | j |
0 Response to Help in 'moving common' command
Post a Comment