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
How to test the difference of the sample mean difference?Dear all, I have return data for two types of firms from the year 2015 to 2016, I know how to test t…
Estimation of the gravity model only with GDP of the partners of a country to assess the determinants of exports of a specific countryDear All. I am working on a gravity model to evaluate the determinants of Colombian exports. To do …
Bootstrap as manualHi, I'm studying bootstrap for microarray analysis. I found this code from http://www.compgen.org/t…
bootstrap with manualsorry. I moved my post here https://www.statalist.org/forums/for...trap-as-manual …
Load dataset from OneDrive web folderDear fellows, I am trying to load a dataset "A.dta" from my personal OneDrive folder, but I have som…
Subscribe to:
Post Comments (Atom)
0 Response to creating a count variable for multiple entries per year
Post a Comment