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!
Related Posts with Identify the time dimension in unbalanced dataset
Loop to avoid using more variables than Stata allowsHi everyone, I am working with a lot of data and could really use your help. I am trying to create …
Simultaneous equationsHello, I am doing accounting research. Recently I read a research paper using the generalized metho…
Launch of Cross Sectional Dependence Tests in StataHi Dear, Can you please tell me when or in which year and month Stata introduced cross sectional de…
FMM with GLM yields strange results on simulated dataHello Statalist Community, I am trying to test the capabilities of STATA 15's FMM procedure to esti…
FMMwith GLM yields strange results on simulated dataHello Statalist Community, I am trying to test the capabilities of STATA 15's FMM procedure to esti…
Subscribe to:
Post Comments (Atom)
0 Response to Identify the time dimension in unbalanced dataset
Post a Comment