Hello Stata professionals,
I have a Data set of different ID's, each ID has observations from their age 20 up to age 55 with country of origin and year, in which they are at each age.
I have now generatet a variable where you can see whether there is a economic crisis =1 or not=0 in each year and country of origin.
now i want to count the number of crisis these people have had during their age 20 and 55:
How do I do it ?
example of first 5 rows:
+----------------------------------------------------------+
mergeid yrbirth age year country crisis_1
1. AT-001215-01 1939 43 1982 Austria 0
2. AT-001215-01 1939 30 1969 Austria 0
3. AT-001215-01 1939 26 1965 Austria 0
4. AT-001215-01 1939 41 1980 Austria 0
5. AT-001215-01 1939 25 1964 Austria 0
***there are way more mergeid's than just one
Related Posts with How to count occurrences by id
Question about reghdfe commandDear all.When we use reghdfe to run pannel fixed-effects model,which kind of Rsq should we report in…
-xtoverid-Dear Statalists, I am new here and need help to download the community-contributed command -xtoveri…
Question about graph plotDear all.I have plot two graphs, namely, figure A and figure B. now I want to embed figure B into fi…
Testing individual coefficients across different regressionsI want to understand the different impact of education and number of children on the probability of …
difference to difference-introduction of minimum wage in a specific yearDear users, As part of my coursework i am analysing the effect of introduction of minimum wage on e…
Subscribe to:
Post Comments (Atom)
0 Response to How to count occurrences by id
Post a Comment