Hi
I have the following data that provides information on natural disasters, their start/end dates and total affected.
I want a count of how many disasters happened in a year. For example, in 1980, we have 3 events (earthquake, drought and flood). For 1984 we have 3 events (2 droughts that lasted from 1983-85 and one from 1980-85).
As far as I can see, to be able to count the number of events a year, I need to expand the dataset by adding rows to it, to reflect natural disasters that lasted beyond a year. So the first drought in the dataset that lasted from 1983-1985, two extra rows need to be added with the following information
For the third drought entry the following rows will be added:
Can anyone kindly suggest how I may add new rows as required? Thanks!
I have the following data that provides information on natural disasters, their start/end dates and total affected.
Code:
input str22 disastertype int(startyear endyear) long totalaffected "Earthquake" 1980 1980 930317 "Drought" 1983 1985 12500000 "Drought" 1983 1985 2100000 "Drought" 1980 1985 500000 "Flood" 1980 1980 30000
As far as I can see, to be able to count the number of events a year, I need to expand the dataset by adding rows to it, to reflect natural disasters that lasted beyond a year. So the first drought in the dataset that lasted from 1983-1985, two extra rows need to be added with the following information
Code:
"Drought" 1984 1985 1250000 "Drought" 1985 1985 1250000
Code:
"Drought" 1981 1985 500000 "Drought" 1982 1985 500000 "Drought" 1983 1985 500000 "Drought" 1984 1985 500000 "Drought" 1985 1985 500000
Comment