Hello everyone,
I have a dataset covering natural disasters in the US for each county from 1994. I want to create a dummy variable if a certain type of hazard say "Flooding" hit a certain county in a certain year. However, I want to exclude counties which were hit in a certain year if there was a similar hazard in previous 3 years. Just to give an example: if county Talbot gets hit twice in a window of 3 years, I want the dummy to take value of 1 only for the first event, but not for the second. Below an example from my data set.
Thank you in advance!
input str20 state int Year str20 county long fips str26 Hazard byte Quarter
"GEORGIA" 1994 "Randolph" 13243 "Flooding" 3
"GEORGIA" 1994 "Rockdale" 13247 "Flooding" 3
"GEORGIA" 1994 "Schley" 13249 "Flooding" 3
"GEORGIA" 1998 "Seminole" 13253 "Flooding" 1
"GEORGIA" 1994 "Spalding" 13255 "Flooding" 3
"GEORGIA" 1998 "Spalding" 13255 "Flooding" 1
"GEORGIA" 2004 "Spalding" 13255 "Flooding" 3
"GEORGIA" 2004 "Stephens" 13257 "Flooding" 3
"GEORGIA" 2009 "Stephens" 13257 "Flooding" 3
"GEORGIA" 1994 "Stewart" 13259 "Flooding" 3
"GEORGIA" 1994 "Sumter" 13261 "Flooding" 3
"GEORGIA" 1998 "Sumter" 13261 "Flooding" 1
"GEORGIA" 1994 "Talbot" 13263 "Flooding" 3
"GEORGIA" 1998 "Talbot" 13263 "Flooding" 1
"GEORGIA" 1994 "Taylor" 13269 "Flooding" 3
"GEORGIA" 1998 "Telfair" 13271 "Flooding" 1
"GEORGIA" 2004 "Telfair" 13271 "Flooding" 3
"GEORGIA" 2009 "Telfair" 13271 "Flooding" 2
"GEORGIA" 1994 "Terrell" 13273 "Flooding" 3
"GEORGIA" 1998 "Terrell" 13273 "Flooding" 1
"GEORGIA" 1994 "Thomas" 13275 "Flooding" 4
"GEORGIA" 1998 "Thomas" 13275 "Flooding" 1
"GEORGIA" 1994 "Tift" 13277 "Flooding" 4
"GEORGIA" 2004 "Toombs" 13279 "Flooding" 3
"GEORGIA" 2009 "Toombs" 13279 "Flooding" 2
"GEORGIA" 2004 "Towns" 13281 "Flooding" 3
"GEORGIA" 1998 "Treutlen" 13283 "Flooding" 1
"GEORGIA" 2004 "Treutlen" 13283 "Flooding" 3
"GEORGIA" 1994 "Troup" 13285 "Flooding" 3
"GEORGIA" 2015 "Troup" 13285 "Flooding" 4
"GEORGIA" 1994 "Twiggs" 13289 "Flooding" 3
Related Posts with Create a dummy for windows of observations
Ordered Probit PostestimationDear all Stata users, I have been trying to do postestimation for a ordered probit model for each o…
How to drop year observations from a variableI am using V-dem version 6. In the year variable, observations begin from 1789. I want to use 'drop'…
How to specifiy dummy variables/ exporting multiregression to word document?Array So I'm running a multiregression on the effect that age plays on duration of unemployment. …
merging variableshello. How do i merge a single variable from a using data set to the main data set? …
Repeated Measures ANOVAHi, I would like to know how to do the repeated measures ANOVA analysis with the following data - I …
Subscribe to:
Post Comments (Atom)
0 Response to Create a dummy for windows of observations
Post a Comment