I am a new Stata user. I would like to count the total number from the first year to the last year given a value, including missing values.
That's how the table should look like:
id | qt1_2000 | qt2_2000 | qt3_2000 | qt4_2000 | qt1_2001 | qt2_2001 | qt3_2001 | qt4_2001 | count |
1 | 1.1 | 1.2 | . | . | 1.1 | 1.2 | . | 1.4 | 8 |
2 | 2.1 | 2.2 | 2.3 | 2.4 | 2.1 | 2.2 | 2.3 | 2.4 | 8 |
3 | . | . | 3.3 | 3.4 | 3.1 | . | 3.3 | . | 5 |
4 | . | 4.2 | 4.3 | . | 4.1 | 4.2 | . | . | 5 |
5 | . | 5.2 | . | 5.4 | . | 5.2 | . | 5.3 | 7 |
Is anybody here who can help me with this issue?
Thank you for your time and insights.
0 Response to Using the egen command
Post a Comment