Hi there,
I'm having an unblanced dataset which look like as the following:
id year values
1 2000 123
1 2001 234
1 2002 .....
1 2003 ....
2 2001
2 2002
2 2003
2 2004
2 2005
3 2000
3 2004
3 2005
3 2008
3 2009
I would like to balance the unbalanced dataset. Difficuties I face here:
1. for each id, they may not have data across all period.
2. for each id, the year may not be continous. E.g. for id 3 from 2000 to 2009, value of x is missing during 2001 and 2003. This difficulty stops me from trying xtbalance, range(), since I'm not sure about the rangem, that is which years covers the most of my observations.
what I will have finally from the table above:
id year values
2 2004
2 2005
3 2004
3 2005
That is to say, keep the years which covers most of my observations.
Any suggestions will be appreciated!
0 Response to Identify the time dimension in unbalanced dataset
Post a Comment