Hello Statalist,
I needed some help on how to go about achieving the following:
I have a county year panel data that looks like the following:
Then I have the county adjacency file that list the neighbors (contiguous) of a given county: (the number of neighbors may obviously be different for different counties) in the following manner:
What I wanted is to create one more variable in my panel say "County Z score" that standardizes ( i.e.it contains the output of the following calculation: county_xyz_score (c,t) - average of county_xyz_score across all contiguous counties (t) / std deviation county_xyz_score across all contiguous counties (t)) "County XYZ score" among contiguous counties.
I needed some help on how to go about achieving the following:
I have a county year panel data that looks like the following:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double state_county float(activity_year county_xyz_score) 1001 2002 .3209993 1001 2002 .3209993 1001 2002 .3209993 1001 2002 .3209993 1001 2002 .3209993 1001 2002 .3209993 1001 2002 .3209993 1003 2002 .2289018 1003 2002 .2289018 1003 2002 .2289018 1003 2002 .2289018
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long county str37 n_name long n_county 1001 "Autauga County, AL" 1001 . "Chilton County, AL" 1021 . "Dallas County, AL" 1047 . "Elmore County, AL" 1051 . "Lowndes County, AL" 1085 . "Montgomery County, AL" 1101 1003 "Baldwin County, AL" 1003 . "Clarke County, AL" 1025 . "Escambia County, AL" 1053 . "Mobile County, AL" 1097 . "Monroe County, AL" 1099 . "Washington County, AL" 1129 . "Escambia County, FL" 12033
Comment