I have a pannel dataset that is organized by country, code, year, and Disaster type.
the disaster variable has 5 kinds of observations "Bio, Hydro, Climat, geo, & Meteo." For example:
Country Code Year Disaster type
Algeria DZA 1980 Geophysical
Algeria DZA 1981 Hydrological
Algeria DZA 1981 Hydrological
Algeria DZA 1981 Biological
I want to create 2 variables one that sums up the biological events for each year and another that sums up the 4 remaining categories, without having to duplicate the year. For example:
Country Code Year occurrence_h occurance_w
Algeria DZA 1980 0 1
Algeria DZA 1981 1 2
I tried creating dummy variables for each disaster type however I couldn't do anything after that. I would be grateful for any ideas on how I can sort out this problem.
Thanks in advance
Related Posts with creating a count variable for multiple entries per year
Forvalues questionHello, I just want to check I have got some code right that I had been having some problems with I…
Fairlie decomposition for Panel dataI am trying to use fairlie decomposition technique (I am using mvdcmp as it produces same results as…
30 day windows using columnsHi , I dont think -rangestat-will work for this issue using the -datex- output provided below I wou…
Is it possible to make the computer game "pong" in stata?I'm trying to make a (simplified) version of the 1972 arcade game "Pong" in Stata but I've run into …
Grouped data to individal patient dataI have some binary grouped data like events1, events2, n1, n2 (see below). But I want to translate i…
Subscribe to:
Post Comments (Atom)
0 Response to creating a count variable for multiple entries per year
Post a Comment