{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww25020\viewh15120\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. * READ IN DATA \
\
. *(DATA ON EMPLOYMENT BY INDUSTRY IN JEFFERSON COUNTY ALABAMA AND ITS NEIGHBORING COUNTIES)\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. insheet using "/Users/aprilharris/Documents/Academic/Harris School/Classes/2nd yr/Fall 09/Practicum/Data/employ_special/aah/NHGIS/employ_s\
> pec_indx_data/onlyjeffco/employment_alabama_bycounty_jeffandsurround_byindustry.csv.txt"\
(13 vars, 152 obs)\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *DESCRIBE DATA TO SEE WHAT IS IN DATASET\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. describe\
\
Contains data\
  obs:           152                          \
 vars:            13                          \
 size:        23,560 (99.8% of memory free)\
--------------------------------------------------------------------------------------------------------------------------------------------\
              storage  display     value\
variable name   type   format      label      variable label\
--------------------------------------------------------------------------------------------------------------------------------------------\
year            str9   %9s                    YEAR\
gisjoin         str8   %9s                    GISJOIN\
state           str7   %9s                    STATE\
statea          byte   %8.0g                  STATEA\
county          str10  %10s                   COUNTY\
countya         int    %8.0g                  COUNTYA\
sic             str33  %33s                   SIC\
sica            str4   %9s                    SICA\
naics           str63  %63s                   NAICS\
naicsa          str6   %9s                    NAICSA\
v11             int    %8.0g                  YEAR\
yeara           int    %8.0g                  YEARA\
v0000001nt001~m long   %12.0g                 V0000001: NT001 (CBP_1998_2003_CNTY): Mid-March employees\
--------------------------------------------------------------------------------------------------------------------------------------------\
Sorted by:  \
     Note:  dataset has changed since last saved\
\
. *NOTE: v11 is the name given to the 'year' variable by STATA because the original data set had two variables with the same name\
\
. *NOTE:  The two year variables, year and v11, do not have the same information.\
\
. *NOTE:  year is the group of years (i.e. 1998-2002) from which this data was pulled; v11 is the actual single year (2002) of the data\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *GET A SENSE OF THE RANGE OF THE DATA USING SUMMARIZE COMMAND\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. summarize\
\
    Variable |       Obs        Mean    Std. Dev.       Min        Max\
-------------+--------------------------------------------------------\
        year |         0\
     gisjoin |         0\
       state |         0\
      statea |       152          10           0         10         10\
      county |         0\
-------------+--------------------------------------------------------\
     countya |       152    828.2895    493.5663         70       1270\
         sic |         0\
        sica |         0\
       naics |         0\
      naicsa |         0\
-------------+--------------------------------------------------------\
         v11 |       152        2002           0       2002       2002\
       yeara |       152        2002           0       2002       2002\
v0000001nt~m |       152    6669.171    29669.71          0     346939\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. edit\
- preserve\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *ABOUT VARIABLES:\
\
. */year = year group RENAME yeargrp; state = state name; statea = state code  (what coding system is used here?; these are not fips codes.)\
. ; county = county name; countya = county code (coding system?); sic = not applicable DELETE (switch from SIC to NAICS occurred before the \
. year of the data contained here so this industry coding system is irrelevant for this data); sica = not applicable DELETE; naics = naics i\
. nustry name; naicsa = naics industry code (1st: remove "---" using ignore command; 2nd: convert to a numeric variable using the real comma\
. nd); v11 = year DELETE; yeara = year code; v00...mid-march employees = number of employees RENAME employees /*\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *year var\
\
. rename year yeargrp\
\
. *state var\
\
. label variable state `"STATE NAME"'\
\
. *statea var\
\
. label variable statea `"STATE CODE"'\
\
. *county var\
\
. label variable county `"COUNTY NAME"'\
\
. *countya var\
\
. label variable countya `"COUNTY CODE"'\
\
. *sic var\
\
. drop sic\
\
. *sica var\
\
. drop sica\
\
. *naics var\
\
. label variable naics `"NAICS INDUSTRY NAME"'\
\
. *naicsa var\
\
. label variable naicsa `"NAICS INDUSTRY CODE"'\
\
. edit\
- preserve\
(1 var, 152 obs pasted into editor)\
- preserve\
\
. */above data edit dropped "----" in naicsa var and changed "------" value for county total to 00 as that code is not used as an industry*/\
\
. *v11 var\
\
. drop v11\
\
. *yeara var\
\
. label variable yeara `"YEAR CODE"'\
\
. *v0000001nt001cbp_1998_2003_cntym var\
\
. rename v0000001nt001cbp_1998_2003_cntym employees\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
.                     *CONVERT naicsa var to numeric var using command real(naicsa)\
\
.                     gen realnaicsa=real(naicsa)\
\
. edit\
- preserve\
\
.                          *MAKE naicsa = realnaicsa\
\
.                          *DROP naicsa\
\
.                          drop naicsa\
\
.                          *RENAME "realnaicsa" "naicsa"\
\
.                           rename realnaicsa naicsa\
\
.                           label variable naicsa `"NAICS INDUSTRY CODE"'\
\
. ***************************************************************************************************************************************** \
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. edit\
- preserve\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. */need to save data under different name to preserve original data.  should have done this first, but forgot.  no relevant data has been d\
> ropped, however.*/\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. save "/Users/aprilharris/Documents/Academic/Harris School/Classes/2nd yr/Fall 09/Practicum/Data/employ_special/aah/NHGIS/employ_spec_indx_\
> data/onlyjeffco/trial calculations/2nd trial.dta"\
file /Users/aprilharris/Documents/Academic/Harris School/Classes/2nd yr/Fall 09/Practicum/Data/employ_special/aah/NHGIS/employ_spec_indx_dat\
> a/onlyjeffco/trial calculations/2nd trial.dta saved\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. edit\
- preserve\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. */Using reshape command to transform data.\
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. reshape wide employees, i(statea countya) j(naicsa)\
(note: j = 0 11 21 22 23 31 42 44 48 51 52 53 54 55 56 61 62 71 72 81 95 99)\
naics not constant within statea countya\
Type "reshape error" for a listing of the problem observations.\
r(9);\
\
. reshape error\
(note: j = 0 11 21 22 23 31 42 44 48 51 52 53 54 55 56 61 62 71 72 81 95 99)\
\
i (statea countya) indicates the top-level grouping such as subject id.\
j (naicsa) indicates the subgrouping such as time.\
xij variable is employees.\
Thus, the following variable(s) should be constant within i:\
      yeargrp gisjoin state county naics yeara\
\
naics not constant within i (statea countya) for 7 values of i:\
\
     +---------------------------------------------------------------------------------------------+\
     | statea   countya   naicsa                                                             naics |\
     |---------------------------------------------------------------------------------------------|\
  1. |     10        70        0                                                      ------ Total |\
  2. |     10        70       11        11---- Forestry, fishing, hunting, and agriculture support |\
  3. |     10        70       21                                                     21---- Mining |\
  4. |     10        70       22                                                  22---- Utilities |\
  5. |     10        70       23                                               23---- Construction |\
     |---------------------------------------------------------------------------------------------|\
  6. |     10        70       31                                              31---- Manufacturing |\
  7. |     10        70       42                                            42---- Wholesale trade |\
  8. |     10        70       44                                               44---- Retail trade |\
  9. |     10        70       48                             48---- Transportation and warehousing |\
 10. |     10        70       51                                                51---- Information |\
     |---------------------------------------------------------------------------------------------|\
 11. |     10        70       52                                      52---- Finance and insurance |\
 12. |     10        70       53                         53---- Real estate and rental and leasing |\
 13. |     10        70       54            54---- Professional, scientific and technical services |\
 14. |     10        70       55                    55---- Management of companies and enterprises |\
 15. |     10        70       56            56---- Admin, support, waste mgt, remediation services |\
     |---------------------------------------------------------------------------------------------|\
 16. |     10        70       61                                       61---- Educational services |\
 17. |     10        70       62                          62---- Health care and social assistance |\
 18. |     10        70       71                         71---- Arts, entertainment and recreation |\
 19. |     10        70       72                            72---- Accommodation and food services |\
 20. |     10        70       81              81---- Other services (except public administration) |\
     |---------------------------------------------------------------------------------------------|\
 21. |     10        70       99                                99---- Unclassified establishments |\
 22. |     10        90        0                                                      ------ Total |\
 23. |     10        90       11        11---- Forestry, fishing, hunting, and agriculture support |\
 24. |     10        90       21                                                     21---- Mining |\
 25. |     10        90       22                                                  22---- Utilities |\
     |---------------------------------------------------------------------------------------------|\
 26. |     10        90       23                                               23---- Construction |\
 27. |     10        90       31                                              31---- Manufacturing |\
 28. |     10        90       42                                            42---- Wholesale trade |\
 29. |     10        90       44                                               44---- Retail trade |\
 30. |     10        90       48                             48---- Transportation and warehousing |\
     |---------------------------------------------------------------------------------------------|\
 31. |     10        90       51                                                51---- Information |\
 32. |     10        90       52                                      52---- Finance and insurance |\
 33. |     10        90       53                         53---- Real estate and rental and leasing |\
 34. |     10        90       54            54---- Professional, scientific and technical services |\
 35. |     10        90       55                    55---- Management of companies and enterprises |\
     |---------------------------------------------------------------------------------------------|\
 36. |     10        90       56            56---- Admin, support, waste mgt, remediation services |\
 37. |     10        90       61                                       61---- Educational services |\
 38. |     10        90       62                          62---- Health care and social assistance |\
 39. |     10        90       71                         71---- Arts, entertainment and recreation |\
 40. |     10        90       72                            72---- Accommodation and food services |\
     |---------------------------------------------------------------------------------------------|\
 41. |     10        90       81              81---- Other services (except public administration) |\
 42. |     10        90       99                                99---- Unclassified establishments |\
 43. |     10       730        0                                                      ------ Total |\
 44. |     10       730       11        11---- Forestry, fishing, hunting, and agriculture support |\
 45. |     10       730       21                                                     21---- Mining |\
     |---------------------------------------------------------------------------------------------|\
 46. |     10       730       22                                                  22---- Utilities |\
 47. |     10       730       23                                               23---- Construction |\
 48. |     10       730       31                                              31---- Manufacturing |\
 49. |     10       730       42                                            42---- Wholesale trade |\
 50. |     10       730       44                                               44---- Retail trade |\
     |---------------------------------------------------------------------------------------------|\
 51. |     10       730       48                             48---- Transportation and warehousing |\
 52. |     10       730       51                                                51---- Information |\
 53. |     10       730       52                                      52---- Finance and insurance |\
 54. |     10       730       53                         53---- Real estate and rental and leasing |\
 55. |     10       730       54            54---- Professional, scientific and technical services |\
     |---------------------------------------------------------------------------------------------|\
 56. |     10       730       55                    55---- Management of companies and enterprises |\
 57. |     10       730       56            56---- Admin, support, waste mgt, remediation services |\
 58. |     10       730       61                                       61---- Educational services |\
 59. |     10       730       62                          62---- Health care and social assistance |\
 60. |     10       730       71                         71---- Arts, entertainment and recreation |\
     |---------------------------------------------------------------------------------------------|\
 61. |     10       730       72                            72---- Accommodation and food services |\
 62. |     10       730       81              81---- Other services (except public administration) |\
 63. |     10       730       95   95---- Auxiliaries (exc corporate, subsidiary and regional mgt) |\
 64. |     10       730       99                                99---- Unclassified establishments |\
 65. |     10      1150        0                                                      ------ Total |\
     |---------------------------------------------------------------------------------------------|\
 66. |     10      1150       11        11---- Forestry, fishing, hunting, and agriculture support |\
 67. |     10      1150       21                                                     21---- Mining |\
 68. |     10      1150       22                                                  22---- Utilities |\
 69. |     10      1150       23                                               23---- Construction |\
 70. |     10      1150       31                                              31---- Manufacturing |\
     |---------------------------------------------------------------------------------------------|\
 71. |     10      1150       42                                            42---- Wholesale trade |\
 72. |     10      1150       44                                               44---- Retail trade |\
 73. |     10      1150       48                             48---- Transportation and warehousing |\
 74. |     10      1150       51                                                51---- Information |\
 75. |     10      1150       52                                      52---- Finance and insurance |\
     |---------------------------------------------------------------------------------------------|\
 76. |     10      1150       53                         53---- Real estate and rental and leasing |\
 77. |     10      1150       54            54---- Professional, scientific and technical services |\
 78. |     10      1150       55                    55---- Management of companies and enterprises |\
 79. |     10      1150       56            56---- Admin, support, waste mgt, remediation services |\
 80. |     10      1150       61                                       61---- Educational services |\
     |---------------------------------------------------------------------------------------------|\
 81. |     10      1150       62                          62---- Health care and social assistance |\
 82. |     10      1150       71                         71---- Arts, entertainment and recreation |\
 83. |     10      1150       72                            72---- Accommodation and food services |\
 84. |     10      1150       81              81---- Other services (except public administration) |\
 85. |     10      1150       95   95---- Auxiliaries (exc corporate, subsidiary and regional mgt) |\
     |---------------------------------------------------------------------------------------------|\
 86. |     10      1150       99                                99---- Unclassified establishments |\
 87. |     10      1170        0                                                      ------ Total |\
 88. |     10      1170       11        11---- Forestry, fishing, hunting, and agriculture support |\
 89. |     10      1170       21                                                     21---- Mining |\
 90. |     10      1170       22                                                  22---- Utilities |\
     |---------------------------------------------------------------------------------------------|\
 91. |     10      1170       23                                               23---- Construction |\
 92. |     10      1170       31                                              31---- Manufacturing |\
 93. |     10      1170       42                                            42---- Wholesale trade |\
 94. |     10      1170       44                                               44---- Retail trade |\
 95. |     10      1170       48                             48---- Transportation and warehousing |\
     |---------------------------------------------------------------------------------------------|\
 96. |     10      1170       51                                                51---- Information |\
 97. |     10      1170       52                                      52---- Finance and insurance |\
 98. |     10      1170       53                         53---- Real estate and rental and leasing |\
 99. |     10      1170       54            54---- Professional, scientific and technical services |\
100. |     10      1170       55                    55---- Management of companies and enterprises |\
     |---------------------------------------------------------------------------------------------|\
101. |     10      1170       56            56---- Admin, support, waste mgt, remediation services |\
102. |     10      1170       61                                       61---- Educational services |\
103. |     10      1170       62                          62---- Health care and social assistance |\
104. |     10      1170       71                         71---- Arts, entertainment and recreation |\
105. |     10      1170       72                            72---- Accommodation and food services |\
     |---------------------------------------------------------------------------------------------|\
106. |     10      1170       81              81---- Other services (except public administration) |\
107. |     10      1170       95   95---- Auxiliaries (exc corporate, subsidiary and regional mgt) |\
108. |     10      1170       99                                99---- Unclassified establishments |\
109. |     10      1250        0                                                      ------ Total |\
110. |     10      1250       11        11---- Forestry, fishing, hunting, and agriculture support |\
     |---------------------------------------------------------------------------------------------|\
111. |     10      1250       21                                                     21---- Mining |\
112. |     10      1250       22                                                  22---- Utilities |\
113. |     10      1250       23                                               23---- Construction |\
114. |     10      1250       31                                              31---- Manufacturing |\
115. |     10      1250       42                                            42---- Wholesale trade |\
     |---------------------------------------------------------------------------------------------|\
116. |     10      1250       44                                               44---- Retail trade |\
117. |     10      1250       48                             48---- Transportation and warehousing |\
118. |     10      1250       51                                                51---- Information |\
119. |     10      1250       52                                      52---- Finance and insurance |\
120. |     10      1250       53                         53---- Real estate and rental and leasing |\
     |---------------------------------------------------------------------------------------------|\
121. |     10      1250       54            54---- Professional, scientific and technical services |\
122. |     10      1250       55                    55---- Management of companies and enterprises |\
123. |     10      1250       56            56---- Admin, support, waste mgt, remediation services |\
124. |     10      1250       61                                       61---- Educational services |\
125. |     10      1250       62                          62---- Health care and social assistance |\
     |---------------------------------------------------------------------------------------------|\
126. |     10      1250       71                         71---- Arts, entertainment and recreation |\
127. |     10      1250       72                            72---- Accommodation and food services |\
128. |     10      1250       81              81---- Other services (except public administration) |\
129. |     10      1250       95   95---- Auxiliaries (exc corporate, subsidiary and regional mgt) |\
130. |     10      1250       99                                99---- Unclassified establishments |\
     |---------------------------------------------------------------------------------------------|\
131. |     10      1270        0                                                      ------ Total |\
132. |     10      1270       11        11---- Forestry, fishing, hunting, and agriculture support |\
133. |     10      1270       21                                                     21---- Mining |\
134. |     10      1270       22                                                  22---- Utilities |\
135. |     10      1270       23                                               23---- Construction |\
     |---------------------------------------------------------------------------------------------|\
136. |     10      1270       31                                              31---- Manufacturing |\
137. |     10      1270       42                                            42---- Wholesale trade |\
138. |     10      1270       44                                               44---- Retail trade |\
139. |     10      1270       48                             48---- Transportation and warehousing |\
140. |     10      1270       51                                                51---- Information |\
     |---------------------------------------------------------------------------------------------|\
141. |     10      1270       52                                      52---- Finance and insurance |\
142. |     10      1270       53                         53---- Real estate and rental and leasing |\
143. |     10      1270       54            54---- Professional, scientific and technical services |\
144. |     10      1270       55                    55---- Management of companies and enterprises |\
145. |     10      1270       56            56---- Admin, support, waste mgt, remediation services |\
     |---------------------------------------------------------------------------------------------|\
146. |     10      1270       61                                       61---- Educational services |\
147. |     10      1270       62                          62---- Health care and social assistance |\
148. |     10      1270       71                         71---- Arts, entertainment and recreation |\
149. |     10      1270       72                            72---- Accommodation and food services |\
150. |     10      1270       81              81---- Other services (except public administration) |\
     |---------------------------------------------------------------------------------------------|\
151. |     10      1270       95   95---- Auxiliaries (exc corporate, subsidiary and regional mgt) |\
152. |     10      1270       99                                99---- Unclassified establishments |\
     +---------------------------------------------------------------------------------------------+\
\
(data now sorted by statea countya naicsa)\
\
. *QUICK FIX drop naics var\
\
. edit\
- preserve\
\
. drop naics\
\
. reshape wide employees, i(statea countya) j(naicsa)\
(note: j = 0 11 21 22 23 31 42 44 48 51 52 53 54 55 56 61 62 71 72 81 95 99)\
\
Data                               long   ->   wide\
-----------------------------------------------------------------------------\
Number of obs.                      152   ->       7\
Number of variables                   9   ->      29\
j variable (22 values)           naicsa   ->   (dropped)\
xij variables:\
                              employees   ->   employees0 employees11 ... employees99\
-----------------------------------------------------------------------------\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *DESCRIBE AND SUMMARIZE DATA\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. describe\
\
Contains data\
  obs:             7                          \
 vars:            29                          \
 size:           917 (99.9% of memory free)\
--------------------------------------------------------------------------------------------------------------------------------------------\
              storage  display     value\
variable name   type   format      label      variable label\
--------------------------------------------------------------------------------------------------------------------------------------------\
statea          byte   %8.0g                  STATE CODE\
countya         int    %8.0g                  COUNTY CODE\
employees0      long   %12.0g                 0 employees\
employees11     long   %12.0g                 11 employees\
employees21     long   %12.0g                 21 employees\
employees22     long   %12.0g                 22 employees\
employees23     long   %12.0g                 23 employees\
employees31     long   %12.0g                 31 employees\
employees42     long   %12.0g                 42 employees\
employees44     long   %12.0g                 44 employees\
employees48     long   %12.0g                 48 employees\
employees51     long   %12.0g                 51 employees\
employees52     long   %12.0g                 52 employees\
employees53     long   %12.0g                 53 employees\
employees54     long   %12.0g                 54 employees\
employees55     long   %12.0g                 55 employees\
employees56     long   %12.0g                 56 employees\
employees61     long   %12.0g                 61 employees\
employees62     long   %12.0g                 62 employees\
employees71     long   %12.0g                 71 employees\
employees72     long   %12.0g                 72 employees\
employees81     long   %12.0g                 81 employees\
employees95     long   %12.0g                 95 employees\
employees99     long   %12.0g                 99 employees\
yeargrp         str9   %9s                    YEAR\
gisjoin         str8   %9s                    GISJOIN\
state           str7   %9s                    STATE NAME\
county          str10  %10s                   COUNTY NAME\
yeara           int    %8.0g                  YEAR CODE\
--------------------------------------------------------------------------------------------------------------------------------------------\
Sorted by:  statea  countya\
     Note:  dataset has changed since last saved\
\
. *ADDING DESCRIPTIVE LABELS\
\
. label variable employees0 `"total # of employees in county"'\
\
. label variable employees11 `"total # of employees in county in naics industry 11"'\
\
. label variable employees21 `"total # of employees in county in naics industry 21"'\
\
. label variable employees22 `"total # of employees in county in naics industry 22"'\
\
. label variable employees23 `"total # of employees in county in naics industry 23"'\
\
. label variable employees31 `"total # of employees in county in naics industry 31"'\
\
. label variable employees42 `"total # of employees in county in naics industry 42"'\
\
. label variable employees44 `"total # of employees in county in naics industry 44"'\
\
. label variable employees48 `"total # of employees in county in naics industry 48"'\
\
. label variable employees51 `"total # of employees in county in naics industry 51"'\
\
. label variable employees52 `"total # of employees in county in naics industry 52"'\
\
. label variable employees53 `"total # of employees in county in naics industry 53"'\
\
. label variable employees54 `"total # of employees in county in naics industry 54"'\
\
. label variable employees55 `"total # of employees in county in naics industry 55"'\
\
. label variable employees56 `"total # of employees in county in naics industry 56"'\
\
. label variable employees61 `"total # of employees in county in naics industry 61"'\
\
. label variable employees62 `"total # of employees in county in naics industry 62"'\
\
. label variable employees71 `"total # of employees in county in naics industry 71"'\
\
. label variable employees72 `"total # of employees in county in naics industry 72"'\
\
. label variable employees81 `"total # of employees in county in naics industry 81"'\
\
. label variable employees95 `"total # of employees in county in naics industry 95"'\
\
. label variable employees99 `"total # of employees in county in naics industry 99"'\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. summarize\
\
    Variable |       Obs        Mean    Std. Dev.       Min        Max\
-------------+--------------------------------------------------------\
      statea |         7          10           0         10         10\
     countya |         7    818.5714    535.7683         70       1270\
  employees0 |         7    73083.43    123624.7       2586     346939\
 employees11 |         7    110.1429    126.4732          0        326\
 employees21 |         7    586.7143    789.5555          0       1731\
-------------+--------------------------------------------------------\
 employees22 |         7    60.85714    138.2877          0        371\
 employees23 |         7    5364.714    8714.677        356      24477\
 employees31 |         7    7589.714    10779.47        302      30650\
 employees42 |         7    4179.143    7421.956         65      20543\
 employees44 |         7    9589.429    14891.33        518      42374\
-------------+--------------------------------------------------------\
 employees48 |         7    2014.286    3767.791        138      10463\
 employees51 |         7    2802.857    5640.794         37      15470\
 employees52 |         7        5630    11509.54         91      31462\
 employees53 |         7    1237.429    2275.479         24       6303\
 employees54 |         7    3911.286    6889.997         22      19007\
-------------+--------------------------------------------------------\
 employees55 |         7    1423.857    2960.534          0       8109\
 employees56 |         7    5386.286    9316.823          5      25524\
 employees61 |         7    992.1429      1996.4          0       5456\
 employees62 |         7       10108    17815.68        388      49584\
 employees71 |         7         624    1242.467          0       3393\
-------------+--------------------------------------------------------\
 employees72 |         7    5558.714    8346.502        159      23572\
 employees81 |         7    4419.571    7880.736        152      22034\
 employees95 |         5       148.2    256.7766          0        593\
 employees99 |         7    37.85714        75.9          0        206\
     yeargrp |         0\
-------------+--------------------------------------------------------\
     gisjoin |         0\
       state |         0\
      county |         0\
       yeara |         7        2002           0       2002       2002\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. edit\
- preserve\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *TREATING MISSINGNESS\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. edit\
- preserve\
\
. replace employees95=0 if employees95==.\
(2 real changes made)\
\
. edit\
- preserve\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *CHANGING EMPLOYEES0 INTO AN ACCURATE TOTAL OF EMPLOYEES IN EA COUNTY\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. replace employees0=(employees11+employees21+employees22+employees23+employees31+employees42+employees44+employees48+employees51+employees5\
> 3+employees52+employees54+employees55+employees56+employees61+employees62+employees71+employees72+employees81+employees95+employees99+empl\
> oyees99)\
(7 real changes made)\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *Creating employment shares\
\
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. foreach var of varlist employees21-employees99 \{\
  2. gen shr`var'=`var'/employees0\
  3. \}\
\
. sum\
\
    Variable |       Obs        Mean    Std. Dev.       Min        Max\
-------------+--------------------------------------------------------\
      statea |         7          10           0         10         10\
     countya |         7    818.5714    535.7683         70       1270\
  employees0 |         7    71770.71    121403.4       2483     340549\
 employees11 |         7    110.1429    126.4732          0        326\
 employees21 |         7    586.7143    789.5555          0       1731\
-------------+--------------------------------------------------------\
 employees22 |         7    60.85714    138.2877          0        371\
 employees23 |         7    5364.714    8714.677        356      24477\
 employees31 |         7    7589.714    10779.47        302      30650\
 employees42 |         7    4179.143    7421.956         65      20543\
 employees44 |         7    9589.429    14891.33        518      42374\
-------------+--------------------------------------------------------\
 employees48 |         7    2014.286    3767.791        138      10463\
 employees51 |         7    2802.857    5640.794         37      15470\
 employees52 |         7        5630    11509.54         91      31462\
 employees53 |         7    1237.429    2275.479         24       6303\
 employees54 |         7    3911.286    6889.997         22      19007\
-------------+--------------------------------------------------------\
 employees55 |         7    1423.857    2960.534          0       8109\
 employees56 |         7    5386.286    9316.823          5      25524\
 employees61 |         7    992.1429      1996.4          0       5456\
 employees62 |         7       10108    17815.68        388      49584\
 employees71 |         7         624    1242.467          0       3393\
-------------+--------------------------------------------------------\
 employees72 |         7    5558.714    8346.502        159      23572\
 employees81 |         7    4419.571    7880.736        152      22034\
 employees95 |         7    105.8571     221.778          0        593\
 employees99 |         7    37.85714        75.9          0        206\
     yeargrp |         0\
-------------+--------------------------------------------------------\
     gisjoin |         0\
       state |         0\
      county |         0\
       yeara |         7        2002           0       2002       2002\
shremploy~21 |         7    .0100565    .0113257          0   .0262708\
-------------+--------------------------------------------------------\
shremploy~22 |         7     .001499    .0025649          0    .005521\
shremploy~23 |         7    .0854478    .0309902   .0403674   .1433749\
shremploy~31 |         7    .1499071    .0660812   .0900017    .242633\
shremploy~42 |         7    .0484361    .0275087   .0234942     .08597\
shremploy~44 |         7    .1703965    .0518201   .1244285   .2637762\
-------------+--------------------------------------------------------\
shremploy~48 |         7    .0297293    .0126827   .0143104   .0555779\
shremploy~51 |         7    .0246652    .0121343   .0097632   .0454266\
shremploy~52 |         7    .0505692    .0250077   .0271288   .0923861\
shremploy~53 |         7    .0126613    .0046128   .0045448   .0185084\
shremploy~54 |         7    .0379635    .0241425   .0088603   .0811641\
-------------+--------------------------------------------------------\
shremploy~55 |         7    .0125323    .0102586          0   .0245887\
shremploy~56 |         7    .0516381    .0417225   .0020137   .1292084\
shremploy~61 |         7     .006829    .0067105          0   .0160212\
shremploy~62 |         7    .1401283    .0369404   .0770469   .1836822\
shremploy~71 |         7    .0036133    .0045736          0   .0099633\
-------------+--------------------------------------------------------\
shremploy~72 |         7    .0852328     .016079   .0640354   .1055817\
shremploy~81 |         7    .0610052    .0087751   .0472641   .0721389\
shremploy~95 |         7    .0016117    .0033098          0   .0088247\
shremploy~99 |         7    .0004941    .0008085          0   .0021991\
\
. edit\
- preserve\
\
. label variable shremployees21 `"= share of county's employees in naics industry 21"'\
\
. label variable shremployees22 `"= share of county's employees in naics industry 22"'\
\
. label variable shremployees23 `"= share of county's employees in naics industry 23"'\
\
. label variable shremployees31 `"= share of county's employees in naics industry 31"'\
\
. label variable shremployees42 `"= share of county's employees in naics industry 42"'\
\
. label variable shremployees44 `"= share of county's employees in naics industry 44"'\
\
. label variable shremployees48 `"= share of county's employees in naics industry 48"'\
\
. label variable shremployees51 `"= share of county's employees in naics industry 51"'\
\
. label variable shremployees52 `"= share of county's employees in naics industry 52"'\
\
. label variable shremployees53 `"= share of county's employees in naics industry 53"'\
\
. label variable shremployees54 `"= share of county's employees in naics industry 54"'\
\
. label variable shremployees55 `"= share of county's employees in naics industry 55"'\
\
. label variable shremployees56 `"= share of county's employees in naics industry 56"'\
\
. label variable shremployees61 `"= share of county's employees in naics industry 61"'\
\
. label variable shremployees62 `"= share of county's employees in naics industry 62"'\
\
. label variable shremployees71 `"= share of county's employees in naics industry 71"'\
\
. label variable shremployees72 `"= share of county's employees in naics industry 72"'\
\
. label variable shremployees81 `"= share of county's employees in naics industry 81"'\
\
. label variable shremployees95 `"= share of county's employees in naics industry 95"'\
\
. label variable shremployees99 `"= share of county's employees in naics industry 99"'\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. */Creating other employment shares\
\
. */own total employees = employees0; own employees in industry = employees21-employees99; total employees in all counties in all industries\
>  = the sum of employees0*/\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *1.  Creating total employees for each industry\
\
. foreach var of varlist employees21-employees99 \{\
  2. gen tot`var'= sum(`var')\
  3. \}\
\
. \
. *2.  Creating total employees in all counties in all industries\
\
. gen totallindcntys= sum(employees0)\
\
. edit\
- preserve\
\
. *sum() gives a running total thus this is not the desired command\
\
. edit\
- preserve\
\
. egen allemp= max (sum(employees0))\
\
. edit\
- preserve\
\
. *3.  Creating othrshr\
\
. foreach var of varlist employees21-employees99\{\
  2. gen othrshr`var'=(tot`var' - `var')/(allemp - employees0)\
  3. \}\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *Adding labels\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. label variable allemp `"total employees in all counties in all industries"'\
\
. label variable totallindcntys `"running sum of total employees in all counties in all industries"'\
\
. edit\
- preserve\
\
. label variable totemployees21 `"total employees for naics industry 21"'\
\
. label variable totemployees22 `"total employees for naics industry 22"'\
\
. label variable totemployees23 `"total employees for naics industry 23"'\
\
. label variable totemployees31 `"total employees for naics industry 31"'\
\
. label variable totemployees42 `"total employees for naics industry 42"'\
\
. label variable totemployees44 `"total employees for naics industry 44"'\
\
. label variable totemployees48 `"total employees for naics industry 48"'\
\
. label variable totemployees51 `"total employees for naics industry 51"'\
\
. label variable totemployees52 `"total employees for naics industry 52"'\
\
. label variable totemployees53 `"total employees for naics industry 53"'\
\
. label variable totemployees54 `"total employees for naics industry 54"'\
\
. label variable totemployees55 `"total employees for naics industry 55"'\
\
. label variable totemployees56 `"total employees for naics industry 56"'\
\
. label variable totemployees61 `"total employees for naics industry 61"'\
\
. label variable totemployees62 `"total employees for naics industry 62"'\
\
. label variable totemployees71 `"total employees for naics industry 71"'\
\
. label variable totemployees72 `"total employees for naics industry 72"'\
\
. label variable totemployees81 `"total employees for naics industry 81"'\
\
. label variable totemployees95 `"total employees for naics industry 95"'\
\
. label variable totemployees99 `"total employees for naics industry 99"'\
\
. foreach var of varlist othrshremployees21-othrshremployees99\{\
  2. label variable `var' `"employment shares (by industry) for all other counties"'\
  3. \}\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. describe\
\
Contains data\
  obs:             7                          \
 vars:            91                          \
 size:         2,653 (99.9% of memory free)\
--------------------------------------------------------------------------------------------------------------------------------------------\
              storage  display     value\
variable name   type   format      label      variable label\
--------------------------------------------------------------------------------------------------------------------------------------------\
statea          byte   %8.0g                  STATE CODE\
countya         int    %8.0g                  COUNTY CODE\
employees0      long   %12.0g                 total # of employees in county\
employees11     long   %12.0g                 total # of employees in county in naics industry 11\
employees21     long   %12.0g                 total # of employees in county in naics industry 21\
employees22     long   %12.0g                 total # of employees in county in naics industry 22\
employees23     long   %12.0g                 total # of employees in county in naics industry 23\
employees31     long   %12.0g                 total # of employees in county in naics industry 31\
employees42     long   %12.0g                 total # of employees in county in naics industry 42\
employees44     long   %12.0g                 total # of employees in county in naics industry 44\
employees48     long   %12.0g                 total # of employees in county in naics industry 48\
employees51     long   %12.0g                 total # of employees in county in naics industry 51\
employees52     long   %12.0g                 total # of employees in county in naics industry 52\
employees53     long   %12.0g                 total # of employees in county in naics industry 53\
employees54     long   %12.0g                 total # of employees in county in naics industry 54\
employees55     long   %12.0g                 total # of employees in county in naics industry 55\
employees56     long   %12.0g                 total # of employees in county in naics industry 56\
employees61     long   %12.0g                 total # of employees in county in naics industry 61\
employees62     long   %12.0g                 total # of employees in county in naics industry 62\
employees71     long   %12.0g                 total # of employees in county in naics industry 71\
employees72     long   %12.0g                 total # of employees in county in naics industry 72\
employees81     long   %12.0g                 total # of employees in county in naics industry 81\
employees95     long   %12.0g                 total # of employees in county in naics industry 95\
employees99     long   %12.0g                 total # of employees in county in naics industry 99\
yeargrp         str9   %9s                    YEAR\
gisjoin         str8   %9s                    GISJOIN\
state           str7   %9s                    STATE NAME\
county          str10  %10s                   COUNTY NAME\
yeara           int    %8.0g                  YEAR CODE\
shremployees21  float  %9.0g                  = share of county's employees in naics industry 21\
shremployees22  float  %9.0g                  = share of county's employees in naics industry 22\
shremployees23  float  %9.0g                  = share of county's employees in naics industry 23\
shremployees31  float  %9.0g                  = share of county's employees in naics industry 31\
shremployees42  float  %9.0g                  = share of county's employees in naics industry 42\
shremployees44  float  %9.0g                  = share of county's employees in naics industry 44\
shremployees48  float  %9.0g                  = share of county's employees in naics industry 48\
shremployees51  float  %9.0g                  = share of county's employees in naics industry 51\
shremployees52  float  %9.0g                  = share of county's employees in naics industry 52\
shremployees53  float  %9.0g                  = share of county's employees in naics industry 53\
shremployees54  float  %9.0g                  = share of county's employees in naics industry 54\
shremployees55  float  %9.0g                  = share of county's employees in naics industry 55\
shremployees56  float  %9.0g                  = share of county's employees in naics industry 56\
shremployees61  float  %9.0g                  = share of county's employees in naics industry 61\
shremployees62  float  %9.0g                  = share of county's employees in naics industry 62\
shremployees71  float  %9.0g                  = share of county's employees in naics industry 71\
shremployees72  float  %9.0g                  = share of county's employees in naics industry 72\
shremployees81  float  %9.0g                  = share of county's employees in naics industry 81\
shremployees95  float  %9.0g                  = share of county's employees in naics industry 95\
shremployees99  float  %9.0g                  = share of county's employees in naics industry 99\
totemployees21  float  %9.0g                  total employees for naics industry 21\
totemployees22  float  %9.0g                  total employees for naics industry 22\
totemployees23  float  %9.0g                  total employees for naics industry 23\
totemployees31  float  %9.0g                  total employees for naics industry 31\
totemployees42  float  %9.0g                  total employees for naics industry 42\
totemployees44  float  %9.0g                  total employees for naics industry 44\
totemployees48  float  %9.0g                  total employees for naics industry 48\
totemployees51  float  %9.0g                  total employees for naics industry 51\
totemployees52  float  %9.0g                  total employees for naics industry 52\
totemployees53  float  %9.0g                  total employees for naics industry 53\
totemployees54  float  %9.0g                  total employees for naics industry 54\
totemployees55  float  %9.0g                  total employees for naics industry 55\
totemployees56  float  %9.0g                  total employees for naics industry 56\
totemployees61  float  %9.0g                  total employees for naics industry 61\
totemployees62  float  %9.0g                  total employees for naics industry 62\
totemployees71  float  %9.0g                  total employees for naics industry 71\
totemployees72  float  %9.0g                  total employees for naics industry 72\
totemployees81  float  %9.0g                  total employees for naics industry 81\
totemployees95  float  %9.0g                  total employees for naics industry 95\
totemployees99  float  %9.0g                  total employees for naics industry 99\
totallindcntys  float  %9.0g                  running sum of total employees in all counties in all industries\
allemp          float  %9.0g                  total employees in all counties in all industries\
othrshremplo~21 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~22 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~23 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~31 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~42 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~44 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~48 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~51 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~52 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~53 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~54 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~55 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~56 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~61 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~62 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~71 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~72 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~81 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~95 float  %9.0g                  employment shares (by industry) for all other counties\
othrshremplo~99 float  %9.0g                  employment shares (by industry) for all other counties\
--------------------------------------------------------------------------------------------------------------------------------------------\
Sorted by:  statea  countya\
     Note:  dataset has changed since last saved\
\
. summarize\
\
    Variable |       Obs        Mean    Std. Dev.       Min        Max\
-------------+--------------------------------------------------------\
      statea |         7          10           0         10         10\
     countya |         7    818.5714    535.7683         70       1270\
  employees0 |         7    71770.71    121403.4       2483     340549\
 employees11 |         7    110.1429    126.4732          0        326\
 employees21 |         7    586.7143    789.5555          0       1731\
-------------+--------------------------------------------------------\
 employees22 |         7    60.85714    138.2877          0        371\
 employees23 |         7    5364.714    8714.677        356      24477\
 employees31 |         7    7589.714    10779.47        302      30650\
 employees42 |         7    4179.143    7421.956         65      20543\
 employees44 |         7    9589.429    14891.33        518      42374\
-------------+--------------------------------------------------------\
 employees48 |         7    2014.286    3767.791        138      10463\
 employees51 |         7    2802.857    5640.794         37      15470\
 employees52 |         7        5630    11509.54         91      31462\
 employees53 |         7    1237.429    2275.479         24       6303\
 employees54 |         7    3911.286    6889.997         22      19007\
-------------+--------------------------------------------------------\
 employees55 |         7    1423.857    2960.534          0       8109\
 employees56 |         7    5386.286    9316.823          5      25524\
 employees61 |         7    992.1429      1996.4          0       5456\
 employees62 |         7       10108    17815.68        388      49584\
 employees71 |         7         624    1242.467          0       3393\
-------------+--------------------------------------------------------\
 employees72 |         7    5558.714    8346.502        159      23572\
 employees81 |         7    4419.571    7880.736        152      22034\
 employees95 |         7    105.8571     221.778          0        593\
 employees99 |         7    37.85714        75.9          0        206\
     yeargrp |         0\
-------------+--------------------------------------------------------\
     gisjoin |         0\
       state |         0\
      county |         0\
       yeara |         7        2002           0       2002       2002\
shremploy~21 |         7    .0100565    .0113257          0   .0262708\
-------------+--------------------------------------------------------\
shremploy~22 |         7     .001499    .0025649          0    .005521\
shremploy~23 |         7    .0854478    .0309902   .0403674   .1433749\
shremploy~31 |         7    .1499071    .0660812   .0900017    .242633\
shremploy~42 |         7    .0484361    .0275087   .0234942     .08597\
shremploy~44 |         7    .1703965    .0518201   .1244285   .2637762\
-------------+--------------------------------------------------------\
shremploy~48 |         7    .0297293    .0126827   .0143104   .0555779\
shremploy~51 |         7    .0246652    .0121343   .0097632   .0454266\
shremploy~52 |         7    .0505692    .0250077   .0271288   .0923861\
shremploy~53 |         7    .0126613    .0046128   .0045448   .0185084\
shremploy~54 |         7    .0379635    .0241425   .0088603   .0811641\
-------------+--------------------------------------------------------\
shremploy~55 |         7    .0125323    .0102586          0   .0245887\
shremploy~56 |         7    .0516381    .0417225   .0020137   .1292084\
shremploy~61 |         7     .006829    .0067105          0   .0160212\
shremploy~62 |         7    .1401283    .0369404   .0770469   .1836822\
shremploy~71 |         7    .0036133    .0045736          0   .0099633\
-------------+--------------------------------------------------------\
shremploy~72 |         7    .0852328     .016079   .0640354   .1055817\
shremploy~81 |         7    .0610052    .0087751   .0472641   .0721389\
shremploy~95 |         7    .0016117    .0033098          0   .0088247\
shremploy~99 |         7    .0004941    .0008085          0   .0021991\
totemploy~21 |         7    1910.286    1600.315         22       4107\
-------------+--------------------------------------------------------\
totemploy~22 |         7    137.4286    198.6604          0        426\
totemploy~23 |         7    22810.86    15829.14        356      37553\
totemploy~31 |         7    30815.57    21677.16        302      53128\
totemploy~42 |         7    18254.86    12782.86         65      29254\
totemploy~44 |         7    39432.86    27477.75        518      67126\
-------------+--------------------------------------------------------\
totemploy~48 |         7    8853.714    6027.726        138      14100\
totemploy~51 |         7    12654.86    8691.939         37      19620\
totemploy~52 |         7    25690.71    17633.95         91      39410\
totemploy~53 |         7    5355.429    3736.727         24       8662\
totemploy~54 |         7    16770.57    11841.29         22      27379\
-------------+--------------------------------------------------------\
totemploy~55 |         7    6463.143    4464.136          0       9967\
totemploy~56 |         7    23112.86    16384.09          5      37704\
totemploy~61 |         7    4447.857    3072.029          0       6945\
totemploy~62 |         7    42927.57    29691.99        388      70756\
totemploy~71 |         7    2770.286    1933.876          0       4368\
-------------+--------------------------------------------------------\
totemploy~72 |         7    22467.14    16040.62        159      38911\
totemploy~81 |         7    19103.29    13181.08        152      30937\
totemploy~95 |         7    232.8571    351.3092          0        741\
totemploy~99 |         7    172.5714    114.5511          0        265\
totallindc~s |         7    304921.4    212196.3       2483     502395\
-------------+--------------------------------------------------------\
      allemp |         7      502395           0     502395     502395\
othrshrem~21 |         7    .0028449    .0029208          0   .0076544\
othrshrem~22 |         7    .0001604    .0003194          0   .0008723\
othrshrem~23 |         7    .0381982    .0346457          0   .0757368\
othrshrem~31 |         7    .0511903    .0457283          0   .1058137\
-------------+--------------------------------------------------------\
othrshrem~42 |         7    .0305558    .0287565          0    .061448\
othrshrem~44 |         7    .0653841    .0589411          0   .1298682\
othrshrem~48 |         7    .0149254    .0134586          0   .0280066\
othrshrem~51 |         7    .0213989    .0197799          0   .0410159\
othrshrem~52 |         7    .0435594    .0404188          0   .0850649\
-------------+--------------------------------------------------------\
othrshrem~53 |         7    .0089165    .0083513          0   .0173892\
othrshrem~54 |         7    .0278561    .0264043          0   .0559356\
othrshrem~55 |         7     .010885    .0102671          0   .0208549\
othrshrem~56 |         7    .0384723    .0364762          0   .0783415\
othrshrem~61 |         7    .0074929    .0069583          0   .0142214\
-------------+--------------------------------------------------------\
othrshrem~62 |         7    .0715338    .0650554          0   .1396051\
othrshrem~71 |         7    .0046309    .0043882          0   .0089444\
othrshrem~72 |         7     .036842    .0342303          0   .0766419\
othrshrem~81 |         7     .031993    .0292644          0   .0613352\
othrshrem~95 |         7    .0002653    .0005664          0   .0015174\
-------------+--------------------------------------------------------\
othrshrem~99 |         7     .000299    .0002541          0   .0005426\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *CORRECTING OMISSION OF NAICS 11\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
\
. *Creating own employment share\
\
. gen shremployees11=employees11/employees0\
\
. *Creating other employment shares\
\
. *1.Creating total employees for each industry\
\
. gen totemployees11= sum(employees11)\
\
. *3.  Creating employment shares (by industry) for all other counties\
\
. gen othrshremployees11=(totemployees11 - employees11)/(allemp - employees0)\
\
. *Laebling var\
\
. label variable othrshremployees11 `"employment shares (by industry) for all other counties"'\
\
. label variable totemployees11 `"total employees for naics industry 11"'\
\
. label variable shremployees11 `"= share of county's employees in naics industry 11"'\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *Creating indices\
. \
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. *KI\
\
. foreach var of varlist shremployees21-shremployees99 shremployees11\{\
  2. gen adiff`var'=abs(`var' - othr`var')\
  3. \}\
\
. gen ki = adiffshremployees11+adiffshremployees21+adiffshremployees22+adiffshremployees23+adiffshremployees31+adiffshremployees42+adiffshre\
> mployees44+adiffshremployees48+adiffshremployees51+adiffshremployees53+adiffshremployees52+adiffshremployees54+adiffshremployees55+adiffsh\
> remployees56+adiffshremployees61+adiffshremployees62+adiffshremployees71+adiffshremployees72+adiffshremployees81+adiffshremployees95+adiff\
> shremployees99+adiffshremployees99\
\
. summarize ki, detail\
\
                             ki\
-------------------------------------------------------------\
      Percentiles      Smallest\
 1%      .324324        .324324\
 5%      .324324       .3793128\
10%      .324324       .4890116       Obs                   7\
25%     .3793128        .493753       Sum of Wgt.           7\
\
50%      .493753                      Mean           .6610482\
                        Largest       Std. Dev.      .3049605\
75%     .9959017        .493753\
90%            1       .9450341       Variance       .0930009\
95%            1       .9959017       Skewness       .1845497\
99%            1              1       Kurtosis       1.193559\
\
. *****************************************************************************************************************************************\
\
. *HI\
\
. *Creating squares of own shares\
\
. foreach var of varlist shremployees21-shremployees99 shremployees11\{\
  2. gen sq`var'=(`var')^2\
  3. gen sumsq`var'=sum(sq`var')\
  4. \}\
\
. gen hi = (sqshremployees11+sqshremployees21+sqshremployees22+sqshremployees23+sqshremployees31+sqshremployees42+sqshremployees44+sqshrempl\
> oyees48+sqshremployees51+sqshremployees53+sqshremployees52+sqshremployees54+sqshremployees55+sqshremployees56+sqshremployees61+sqshremploy\
> ees62+sqshremployees71+sqshremployees72+sqshremployees81+sqshremployees95+sqshremployees99+sqshremployees99)\
\
. summarize hi, detail\
\
                             hi\
-------------------------------------------------------------\
      Percentiles      Smallest\
 1%     .0841313       .0841313\
 5%     .0841313       .0882547\
10%     .0841313       .1045068       Obs                   7\
25%     .0882547       .1188297       Sum of Wgt.           7\
\
50%     .1188297                      Mean            .113468\
                        Largest       Std. Dev.      .0218507\
75%     .1370507       .1188297\
90%      .138022       .1234812       Variance       .0004775\
95%      .138022       .1370507       Skewness      -.2229372\
99%      .138022        .138022       Kurtosis       1.565163\
\
. *****************************************************************************************************************************************\
\
. *****************************************************************************************************************************************\
\
. \
. \
. \
. \
. \
. */NOTES: get data set of neighboring counties for contiguous 48.  Inputting touching by hand not practical.  If cannot find such data, don\
> 't use touching just calculate KI relative to all counties in state.*/\
\
. save "/Users/aprilharris/Documents/Academic/Harris School/Classes/2nd yr/Fall 09/Practicum/Data/employ_special/aah/NHGIS/employ_spec_indx_\
> data/onlyjeffco/trial calculations/2nd trial.dta", replace\
file /Users/aprilharris/Documents/Academic/Harris School/Classes/2nd yr/Fall 09/Practicum/Data/employ_special/aah/NHGIS/employ_spec_indx_dat\
> a/onlyjeffco/trial calculations/2nd trial.dta saved\
\
. log close\
\
--------------------------------------------------------------------------------------------------------------------------------------------\
}