Hi,
I am trying to find observations where the areaXX variables have changed over time.
Thus, I begin by trying to delete observations where areaXX code has not changed at all over the years (1997 to 2015).
I realize that I cannot use drop command here as it meant for variables as a whole.
Not sure how to use replace command either here. Any suggestions ???
I am trying to find observations where the areaXX variables have changed over time.
Thus, I begin by trying to delete observations where areaXX code has not changed at all over the years (1997 to 2015).
I realize that I cannot use drop command here as it meant for variables as a whole.
Not sure how to use replace command either here. Any suggestions ???
Code:
gen check=. replace check=1 if (area97==area98 & area98==area99 & area99==area00 & area00==area01 /// & area01==area02 & area02==area03 & area03==area05 & area05==area06 /// //2003==2004 & area06==area08 /// //2006==2007 & area08==area10 & area10==area11 /// //2008==2009 & area11==area15 ) //2011==2012==2013==2014
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str2(fp stab) str20 state str3(countycode towncode) str40 countytownname str6(area97 area98 area99 area00 area01 area02 area03) str7(area05 area06 area08 area10 area11 area15) str72 area15name float check "01" "AL" "Alabama" "001" "000" "Autauga County" "5240" "5240" "5240" "5240" "5240" "5240" "5240" " 33860" " 33860" " 33860" " 33860" " 33860" " 33860" "Montgomery, AL" . "01" "AL" "Alabama" "003" "000" "Baldwin County" "5160" "5160" "5160" "5160" "5160" "5160" "5160" "0100003" "0100003" "0100003" "0100003" "0100003" " 19300" "Daphne-Fairhope-Foley, AL" . "01" "AL" "Alabama" "005" "000" "Barbour County" "010004" "010004" "010004" "010004" "010004" "010004" "010004" "0100004" "0100004" "0100004" "0100004" "0100004" "0100004" "Southeast Alabama nonmetropolitan area" . "01" "AL" "Alabama" "007" "000" "Bibb County" "010001" "010001" "010001" "010001" "010001" "010001" "010001" " 13820" " 13820" " 13820" " 13820" " 13820" " 13820" "Birmingham-Hoover, AL" . "01" "AL" "Alabama" "009" "000" "Blount County" "1000" "1000" "1000" "1000" "1000" "1000" "1000" " 13820" " 13820" " 13820" " 13820" " 13820" " 13820" "Birmingham-Hoover, AL" . "01" "AL" "Alabama" "011" "000" "Bullock County" "010004" "010004" "010004" "010004" "010004" "010004" "010004" "0100004" "0100004" "0100004" "0100004" "0100004" "0100004" "Southeast Alabama nonmetropolitan area" . "01" "AL" "Alabama" "013" "000" "Butler County" "010004" "010004" "010004" "010004" "010004" "010004" "010004" "0100004" "0100004" "0100004" "0100004" "0100004" "0100004" "Southeast Alabama nonmetropolitan area" . "01" "AL" "Alabama" "015" "000" "Calhoun County" "0450" "0450" "0450" "0450" "0450" "0450" "0450" " 11500" " 11500" " 11500" " 11500" " 11500" " 11500" "Anniston-Oxford-Jacksonville, AL" . "01" "AL" "Alabama" "017" "000" "Chambers County" "010002" "010002" "010002" "010002" "010002" "010002" "010002" "0100002" "0100002" "0100002" "0100002" "0100002" "0100002" "Northeast Alabama nonmetropolitan area" . "01" "AL" "Alabama" "019" "000" "Cherokee County" "010002" "010002" "010002" "010002" "010002" "010002" "010002" "0100002" "0100002" "0100002" "0100002" "0100002" "0100002" "Northeast Alabama nonmetropolitan area" . end
Comment