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
xtlogit errorwhen i use xtlogit, i encounter error error: 4,585 (group size) take 1,738 (# positives) combinatio…
Postestimation tests with xtsurDear Statalist, I am trying to estimate a regression with Panel data SUR method with the command xt…
Panel regressionHello, I am working with panel data where T=23 and N= 22 (country). I performed the following steps…
How to create graphs from svy weighted data?I svy set my data and tabulated svy weighted values - I am trying to create simple bar graphs from t…
Propensity Score MatchingThis though is not software related, at least not yet, however, I would like to know conditions for …
Subscribe to:
Post Comments (Atom)
0 Response to Identify the time dimension in unbalanced dataset
Post a Comment