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
Preliminary analysis using latent variablesHello, I am running a mediation model where I plan to use two latent variables as mediators. For pr…
Identifying pairs of strings that differ by only two consecutive, inverted charactersI want to identify when two putatively matched surnames (stored as two string variables) differ only…
invariant regressorsDear all, I can't understand what's going on.. I have panel data and when i run BE in stata, indivi…
ivreg2h : (1) for panel data? (2) the same command for single equation and set of fully simultaneous equations?Dear Stata list members, I want to analyze a model using Lewbel's (2012) method of internal instrum…
invalid syntax using cdfplotHi, I am using a user written command cdfplot in Stata 15 to generate normalized cdf by a categoric…
Subscribe to:
Post Comments (Atom)
0 Response to How to count occurrences by id
Post a Comment