---------------------------------------------------------------------------------------------------------------------------------------------------------------------- log: C:\Documents and Settings\alan\My Documents\terrorism\Web for RL\appendix2_1.log log type: text opened on: 18 May 2007, 12:01:49 . clear; . /* COUNT.do > > This program creates a NxN matrix of countries, containing the no. of attacks each country i > has launched against country j. > > The list of N countries with population > 1 million is contained in Count.xls. > > Significant Events from Patterns of Global Terrorism 1997-2003 > > Assigns affected=affected2 if origin = affected1 > > Drops Israel /WB & Gaza > > Drops ij countries. > > November 22, 2004 > > Reassign Kashmir as Pakistan for origin > > > */ > > set mem 300m; (307200k) . set matsize 800; . insheet using count.raw, names; (153 vars, 152 obs) . reshape long o, i(affected) j(count); (note: j = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 > 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 > 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 > 149 150 151 152) Data wide -> long ----------------------------------------------------------------------------- Number of obs. 152 -> 23104 Number of variables 153 -> 3 j variable (152 values) -> count xij variables: o1 o2 ... o152 -> o ----------------------------------------------------------------------------- . replace count=.; (23104 real changes made, 23104 to missing) . rename o origin; . drop if affected=="West Bank and Gaza"; (152 observations deleted) . drop if origin=="West Bank and Gaza"; (151 observations deleted) . sort affected origin; . save count, replace; file count.dta saved . use event4, clear; . rename affected1 affected; . replace origin = "Pakistan" if kashmir==1 ; (253 real changes made) . replace affected = affected2 if affected==origin ; (200 real changes made) . /* country names */ > replace origin="Israel" if origin=="West Bank and Gaza"; (46 real changes made) . replace affected="Israel" if affected=="West Bank and Gaza"; (1 real change made) . bys affected origin: gen count=_N; . keep affected origin count; . bys affected origin: keep if _n==1; (634 observations deleted) . sort affected origin; . merge affected origin using count; . tab _merge; _merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 93 0.41 0.41 2 | 22,572 98.59 99.00 3 | 229 1.00 100.00 ------------+----------------------------------- Total | 22,894 100.00 . drop _merge; . sort affected; . save count,replace; file count.dta saved . use krueglait, clear; . keep if pop>1000000; (9 observations deleted) . gene double gdp = exp(lgdp) ; (9 missing values generated) . replace gdp = 295 if country=="Myanmar" ; (1 real change made) . * Cambodia ; . replace gdp = 368 if country=="Afghanistan"; (1 real change made) . * Tajikistan ; . replace gdp = 914 if country=="Korea, North"; (1 real change made) . * Albania ; . replace gdp = 5000 if country=="Libya" ; (1 real change made) . * http://www.nationmaster.com/country/ly/Economy ; . replace gdp = 113.5 if country=="Somalia" ; (1 real change made) . * Ethiopia ; . replace gdp = 942 if country=="Cuba" ; (1 real change made) . * Guyana ; . replace gdp = 1482 if country=="Yugoslavia"; (1 real change made) . * Bulgaria ; . replace gdp = 1619 if country=="Iraq" ; (1 real change made) . * Iran ; . replace gdp = 12375 if country=="Korea, Rep."; (1 real change made) . * fix up ; . replace lgdp = log(gdp) ; (9 real changes made) . drop if country=="West Bank and Gaza"; (1 observation deleted) . qui for var _all: rename X t_X; . rename t_country affected; . sort affected; . merge affected using count; affected was str26 now str56 variable affected does not uniquely identify observations in count.dta . tab _merge; _merge | Freq. Percent Cum. ------------+----------------------------------- 2 | 91 0.40 0.40 3 | 22,803 99.60 100.00 ------------+----------------------------------- Total | 22,894 100.00 . drop _merge; . sort origin; . save count, replace; file count.dta saved . use krueglait, clear; . keep if pop>1000000; (9 observations deleted) . gene double gdp = exp(lgdp) ; (9 missing values generated) . replace gdp = 295 if country=="Myanmar" ; (1 real change made) . * Cambodia ; . replace gdp = 368 if country=="Afghanistan"; (1 real change made) . * Tajikistan ; . replace gdp = 914 if country=="Korea, North"; (1 real change made) . * Albania ; . replace gdp = 5000 if country=="Libya" ; (1 real change made) . * http://www.nationmaster.com/country/ly/Economy ; . replace gdp = 113.5 if country=="Somalia" ; (1 real change made) . * Ethiopia ; . replace gdp = 942 if country=="Cuba" ; (1 real change made) . * Guyana ; . replace gdp = 1482 if country=="Yugoslavia"; (1 real change made) . * Bulgaria ; . replace gdp = 1619 if country=="Iraq" ; (1 real change made) . * Iran ; . replace gdp = 12375 if country=="Korea, Rep."; (1 real change made) . * fix up ; . replace lgdp = log(gdp) ; (9 real changes made) . drop if country=="West Bank and Gaza"; (1 observation deleted) . qui for var _all: rename X o_X; . rename o_country origin; . sort origin; . merge origin using count; variable origin does not uniquely identify observations in count.dta . tab _merge; _merge | Freq. Percent Cum. ------------+----------------------------------- 2 | 2 0.01 0.01 3 | 22,892 99.99 100.00 ------------+----------------------------------- Total | 22,894 100.00 . drop _merge; . gene o_gr9096 = (o_gdp96 / o_gdp90)^(1/6) - 1 ; (1987 missing values generated) . replace count=0 if count==.; (22572 real changes made) . drop if affected=="" | origin==""; (40 observations deleted) . ** use Haversine distance formula ; . replace t_latitude = t_latitude*-1 if t_lat_d=="S"; (4379 real changes made) . replace o_latitude = o_latitude*-1 if o_lat_d=="S"; (4390 real changes made) . replace t_longitude = t_longitude*-1 if t_long_d=="E"; (16763 real changes made) . replace o_longitude = o_longitude*-1 if o_long_d=="E"; (16803 real changes made) . * convert longitude and latitude to radians ; . gene double lon1 = o_longitude* 0.017453293 ; (2 missing values generated) . gene double lat1 = o_latitude * 0.017453293 ; (2 missing values generated) . gene double lon2 = t_longitude* 0.017453293 ; (51 missing values generated) . gene double lat2 = t_latitude* 0.017453293 ; (51 missing values generated) . gene double dlon = lon2 - lon1 ; (53 missing values generated) . gene double dlat = lat2 - lat1 ; (53 missing values generated) . gene double a = (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2 ; (53 missing values generated) . replace a = 1 if a > 1 & a~=.; (0 real changes made) . gene double c = 2 * asin(a^.5) ; (53 missing values generated) . gene double d = 3956 * c ; (53 missing values generated) . replace d=. if dlon==. | dlat==. ; (0 real changes made) . replace d = d/1000 ; (22650 real changes made) . label var d "distance betw capitals (1000s mi)" ; . * same continent ; . gene same = (t_continent==o_continent) ; . gen self=(affected==origin); . sum ; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- origin | 0 o_code | 22701 448.0101 232.583 2 992 o_muslim | 21946 .2821289 .3746812 0 1 o_christian | 21946 .4968732 .385357 0 1 o_avter | 22701 .8416002 3.47184 0 37.66667 -------------+-------------------------------------------------------- o_totter | 22701 5.029602 20.83699 0 226 o_inc | 21784 6184.331 9994.322 108.4929 45129.19 o_avinc | 21784 6273.374 10154.04 112.3711 45433.08 o_femil | 21181 27.15413 26.99276 0 92.289 o_malil | 21181 17.23416 18.15528 0 77.437 -------------+-------------------------------------------------------- o_avfemil | 20414 25.83368 26.15199 0 92.10925 o_avmalil | 20414 16.43562 17.68152 0 77.137 o_totil | 20569 .2127438 .2184992 0 .8503 o_avtotil | 20414 21.15287 21.67222 0 84.7895 o_pop | 22701 3.90e+07 1.31e+08 1149330 1.24e+09 -------------+-------------------------------------------------------- o_polr | 22399 3.734028 2.200237 1 7 o_civr | 22399 3.91346 1.739463 1 7 o_free | 22399 1.917117 .8042346 1 3 o_elf | 22701 .4631343 .2716319 .003 .984 o_ethnic | 20129 72.51528 22.59961 17 100 -------------+-------------------------------------------------------- o_relfrac | 20585 .3651182 .2240154 0 .7828 o_infmort | 22701 44.05925 39.72026 3 169 o_lpop | 22701 16.27207 1.333026 13.95469 20.93838 o_linc | 21784 7.477844 1.635437 4.686685 10.71728 o_lavinc | 18914 7.50162 1.688031 4.721807 10.724 -------------+-------------------------------------------------------- o_iterate | 20133 5.631799 14.46387 0 148 o_free1 | 19983 .4080969 .4914935 0 1 o_free2 | 19983 .3033078 .4596986 0 1 o_free12 | 19983 .7114047 .4531207 0 1 o_inc1 | 18914 .3846886 .4865345 0 1 -------------+-------------------------------------------------------- o_inc2 | 18914 .2879877 .4528373 0 1 o_q1 | 22701 .3006035 .4585306 0 1 o_q2 | 22701 .2402097 .4272201 0 1 o_q3 | 22701 .2463328 .4308841 0 1 o_interact | 18612 25.91272 10.19113 9.410265 61.73648 -------------+-------------------------------------------------------- o_hindu | 21946 .0289147 .1349895 0 .96 o_jewish | 21795 .6388254 6.644976 0 80.1 o_budhist | 21946 .0497815 .1905378 0 1 o_none | 21795 1.330291 5.733976 0 40 o_total | 21795 100 0 100 100 -------------+-------------------------------------------------------- o_idn | 20285 82.13586 45.65327 1 162 o_mtnest | 19378 18.73508 21.93709 0 82.2 o_old | 22701 .893573 .3083902 0 1 o_infmort_o | 20285 .473735 .4043034 .035 1.64 o_ter97 | 22701 .6033655 2.190415 0 21 -------------+-------------------------------------------------------- o_ter98 | 22701 .7766178 3.640522 0 38 o_ter99 | 22701 1.106163 4.304675 0 36 o_ter00 | 22701 .9529096 4.282588 0 46 o_ter01 | 22701 .769922 3.402586 0 38 o_ter02 | 22701 .8073213 5.529884 0 67 -------------+-------------------------------------------------------- o_terold | 22701 4.242104 15.93069 0 159 o_q1_o | 18914 .2963942 .456679 0 1 o_q2_o | 18914 .2323676 .4223533 0 1 o_q3_o | 18914 .2317331 .4219506 0 1 o_tered | 19518 709765 1748779 463 1.32e+07 -------------+-------------------------------------------------------- o_gdp90 | 20873 5589.884 9007.846 100.3217 45951.95 o_gdp96 | 21480 5937.313 9646.37 53.86044 43573.91 o_gdp97 | 21480 6101.277 9897.519 108.1686 44236.75 o_gdp98 | 21480 6194.652 10059.99 107.7793 45138.21 o_gdp99 | 21178 6307.345 10338.83 100.1296 45679.77 -------------+-------------------------------------------------------- o_gdp00 | 21178 6521.789 10689.83 90.6162 46776.5 o_gdp01 | 21027 6504.857 10741.37 86.41882 47064.41 o_gdp02 | 20574 6471.931 10909.87 86.62396 46993.03 o_avgdp1 | 21480 6225.381 10112.04 106.9705 45081.03 o_avgdp2 | 21480 6357.305 10323.12 99.56818 45779.13 -------------+-------------------------------------------------------- o_civ1 | 22399 .2629135 .4402257 0 1 o_civ2 | 22399 .323943 .467989 0 1 o_ccode | 22550 459.5439 231.3175 2 920 o_Oil | 22550 .1344124 .3411024 0 1 o_polity2l | 22245 2.621713 6.772014 -10 10 -------------+-------------------------------------------------------- o_instab | 22550 .1615965 .3680884 0 1 o_anocl | 22245 .2659024 .4418225 0 1 o_lgdp | 22701 7.446422 1.628148 4.600842 10.73158 o_capital | 0 o_continent | 0 -------------+-------------------------------------------------------- o_lat_d | 0 o_long_d | 0 o_latitude | 22852 20.45103 24.57417 -41.28333 60.16667 o_longitude | 22852 -20.47931 56.56557 -174.7667 99.15 o_other | 21946 .1423017 .1885413 -1.91e-08 .9 -------------+-------------------------------------------------------- o_gdp | 22701 6087.23 10111.08 99.56816 45779.13 affected | 0 t_code | 22652 447.9207 232.6868 2 992 t_muslim | 21897 .2816384 .3745026 0 1 t_christian | 21897 .4971487 .3854204 0 1 -------------+-------------------------------------------------------- t_avter | 22652 .8393814 3.479475 0 37.66667 t_totter | 22652 5.01629 20.88278 0 226 t_inc | 21746 6193.871 10000.39 108.4929 45129.19 t_avinc | 21746 6283.07 10160.21 112.3711 45433.08 t_femil | 21142 27.1205 26.97675 0 92.289 -------------+-------------------------------------------------------- t_malil | 21142 17.21408 18.1481 0 77.437 t_avfemil | 20387 25.81259 26.14631 0 92.10925 t_avmalil | 20387 16.42311 17.67978 0 77.137 t_totil | 20538 .2126105 .218464 0 .8503 t_avtotil | 20387 21.13604 21.66848 0 84.7895 -------------+-------------------------------------------------------- t_pop | 22652 3.91e+07 1.32e+08 1149330 1.24e+09 t_polr | 22350 3.729575 2.199811 1 7 t_civr | 22350 3.909445 1.73853 1 7 t_free | 22350 1.915526 .8040907 1 3 t_elf | 22652 .4628251 .2716419 .003 .984 -------------+-------------------------------------------------------- t_ethnic | 20085 72.55733 22.58691 17 100 t_relfrac | 20538 .3649116 .2240153 0 .7828 t_infmort | 22652 43.9691 39.6453 3 169 t_lpop | 22652 16.27154 1.333726 13.95469 20.93838 t_linc | 21746 7.480261 1.635334 4.686685 10.71728 -------------+-------------------------------------------------------- t_lavinc | 18877 7.504305 1.68805 4.721807 10.724 t_iterate | 20085 5.601593 14.4005 0 148 t_free1 | 19934 .4091 .4916801 0 1 t_free2 | 19934 .3030501 .4595882 0 1 t_free12 | 19934 .7121501 .4527722 0 1 -------------+-------------------------------------------------------- t_inc1 | 18877 .3840653 .4863863 0 1 t_inc2 | 18877 .2879695 .4528288 0 1 t_q1 | 22652 .3000618 .4582947 0 1 t_q2 | 22652 .2399788 .4270797 0 1 t_q3 | 22652 .2466449 .4310677 0 1 -------------+-------------------------------------------------------- t_interact | 18575 25.89944 10.1941 9.410265 61.73648 t_hindu | 21897 .0290211 .1352404 0 .96 t_jewish | 21746 .6402189 6.65239 0 80.1 t_budhist | 21897 .049892 .1907366 0 1 t_none | 21746 1.333211 5.740091 0 40 -------------+-------------------------------------------------------- t_total | 21746 100 0 100 100 t_idn | 20236 82.14494 45.62675 1 162 t_mtnest | 19330 18.70029 21.90746 0 82.2 t_old | 22652 .8933428 .3086838 0 1 t_infmort_o | 20236 .4728175 .4035963 .035 1.64 -------------+-------------------------------------------------------- t_ter97 | 22652 .5999912 2.1817 0 21 t_ter98 | 22652 .7749426 3.64727 0 38 t_ter99 | 22652 1.101536 4.303056 0 36 t_ter00 | 22652 .9486138 4.288667 0 46 t_ter01 | 22652 .7683207 3.411683 0 38 -------------+-------------------------------------------------------- t_ter02 | 22652 .8095532 5.552302 0 67 t_terold | 22652 4.226735 15.94757 0 159 t_q1_o | 18877 .2960746 .4565364 0 1 t_q2_o | 18877 .2319754 .4221046 0 1 t_q3_o | 18877 .2319754 .4221046 0 1 -------------+-------------------------------------------------------- t_tered | 19481 710694.9 1750571 463 1.32e+07 t_gdp90 | 20840 5597.522 9012.862 100.3217 45951.95 t_gdp96 | 21444 5946.18 9651.982 53.86044 43573.91 t_gdp97 | 21444 6110.356 9903.286 108.1686 44236.75 t_gdp98 | 21444 6203.883 10065.85 107.7793 45138.21 -------------+-------------------------------------------------------- t_gdp99 | 21142 6316.903 10344.99 100.1296 45679.77 t_gdp00 | 21142 6531.682 10696.19 90.6162 46776.5 t_gdp01 | 20991 6514.767 10747.86 86.41882 47064.41 t_gdp02 | 20538 6481.977 10916.74 86.62396 46993.03 t_avgdp1 | 21444 6234.674 10117.93 106.9705 45081.03 -------------+-------------------------------------------------------- t_avgdp2 | 21444 6366.795 10329.13 99.56818 45779.13 t_civ1 | 22350 .2634899 .4405357 0 1 t_civ2 | 22350 .3243848 .468155 0 1 t_ccode | 22501 459.4496 231.4141 2 920 t_Oil | 22501 .1342163 .3408921 0 1 -------------+-------------------------------------------------------- t_polity2l | 22199 2.633092 6.77139 -10 10 t_instab | 22501 .1610595 .367594 0 1 t_anocl | 22199 .2652822 .4414933 0 1 t_lgdp | 22652 7.449307 1.628072 4.600842 10.73158 t_capital | 0 -------------+-------------------------------------------------------- t_continent | 0 t_lat_d | 0 t_long_d | 0 t_latitude | 22803 20.45955 24.58405 -41.28333 60.16667 t_longitude | 22803 -20.47002 56.59692 -174.7667 99.15 -------------+-------------------------------------------------------- t_other | 21897 .1422998 .1886337 -1.91e-08 .9 t_gdp | 22652 6098.812 10118.88 99.56816 45779.13 count | 22854 .0367551 1.722349 0 252 o_gr9096 | 20873 -.0009403 .0497541 -.1950868 .1110597 lon1 | 22852 -.3574314 .9872555 -3.050254 1.730494 -------------+-------------------------------------------------------- lat1 | 22852 .3569378 .4289001 -.7205301 1.050106 lon2 | 22803 -.3572692 .9878026 -3.050254 1.730494 lat2 | 22803 .3570866 .4290726 -.7205301 1.050106 dlon | 22801 0 1.396947 -4.780748 4.780748 dlat | 22801 0 .6068252 -1.770637 1.770637 -------------+-------------------------------------------------------- a | 22801 .3192283 .2667939 0 .9999575 c | 22801 1.126886 .6637225 0 3.128558 d | 22801 4.457963 2.625686 0 12.37657 same | 22854 .2373764 .4254841 0 1 self | 22854 .0066072 .0810172 0 1 . sum d if self==1 ; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- d | 151 0 0 0 0 . gene ot_lgdp = o_lgdp * t_lgdp ; (354 missing values generated) . sort origin affected ; . save temp ; file temp.dta saved . clear ; . use trade ; . rename importer origin ; . rename exporter affected ; . sort origin affected ; . rename trade imports ; . merge origin affected using temp ; origin was str17 now str26 affected was str17 now str56 . sort origin affected ; . label var imports "imports to origin country" ; . tab _merge ; _merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 2,395 9.49 9.49 2 | 1,533 6.07 15.56 3 | 21,321 84.44 100.00 ------------+----------------------------------- Total | 25,249 100.00 . drop _merge ; . save temp, replace ; file temp.dta saved . clear ; . use trade ; . rename importer affected ; . rename exporter origin ; . sort origin affected ; . merge origin affected using temp ; affected was str17 now str56 origin was str17 now str26 . rename trade exports ; . label var exports "Exports from origin country" ; . tab _merge ; _merge | Freq. Percent Cum. ------------+----------------------------------- 2 | 1,533 6.07 6.07 3 | 23,716 93.93 100.00 ------------+----------------------------------- Total | 25,249 100.00 . gene trade = (imports+exports)/((o_pop*t_pop)^.5) ; (4369 missing values generated) . replace exports = (exports)/((o_pop*t_pop)^.5) ; exports was long now double (15952 real changes made, 2682 to missing) . replace imports = (imports)/((o_pop*t_pop)^.5) ; imports was long now double (15952 real changes made, 2682 to missing) . erase temp.dta ; . gene occupier = 0 ; . replace occupier =1 if affected=="U.S.A." | affected=="Israel" | affected=="U.K." | affected == "Indonesia" | affected =="Armenia" > | affected =="Turkey" | affected =="Israel" | affected=="Syria" | affected=="Morocco" | affected == "Uganda" | affected=="Rwanda" > | affected=="Burundi" | affected=="Angola" | affected=="Namibia" | affected=="Ethiopia" | affected=="Nigeria" ; (2377 real changes made) . gene occupied=0 ; . replace occupied=1 if origin=="Iraq" | origin=="Afghanistan" | origin=="East Timor" | origin=="Cyprus" | origin=="Lebanon" > | origin=="Syria" | origin=="Drc" | origin=="Eritrea" | origin=="Sierra Leone" ; (1269 real changes made) . #delimit cr delimiter now cr . . egen double o_max=rmax( o_muslim o_christian o_hindu o_budhist o_other) (3303 missing values generated) . egen double t_max=rmax(t_muslim t_christian t_hindu t_budhist t_other) (3352 missing values generated) . . gen str20 o_mrelig="" (25249 missing values generated) . gen str20 t_mrelig="" (25249 missing values generated) . . foreach i in o_ t_{ 2. foreach j in christian hindu budhist other muslim { 3. replace `i'mrelig="`j'" if `i'max==`i'`j' 4. } 5. } (15256 real changes made) (3907 real changes made) (4662 real changes made) (5116 real changes made) (9823 real changes made) (15281 real changes made) (3957 real changes made) (4711 real changes made) (5164 real changes made) (9846 real changes made) . . gen samerel =(o_mrelig==t_mrelig) . tab samerel samerel | Freq. Percent Cum. ------------+----------------------------------- 0 | 14,255 56.46 56.46 1 | 10,994 43.54 100.00 ------------+----------------------------------- Total | 25,249 100.00 . . . gen diffrel = 1-samerel . replace diffrel = . if o_muslim==. | t_muslim==. (4224 real changes made, 4224 to missing) . drop samerel . . #delimit; delimiter now ; . /* regressions for ij off diagonals */ > > > > keep if self==0 ; (2546 observations deleted) . gene o_gdpc = . ; (22703 missing values generated) . replace o_gdpc = 1 if o_lgdp < 6.008 & o_lgdp~=.; (5727 real changes made) . replace o_gdpc = 2 if 6.008<= o_lgdp & o_lgdp < 7.301 ; (5262 real changes made) . replace o_gdpc = 3 if 7.301 <= o_lgdp & o_lgdp < 8.517 ; (5862 real changes made) . replace o_gdpc = 4 if o_lgdp >= 8.517 & o_lgdp~=. ; (5700 real changes made) . gene t_gdpc = . ; (22703 missing values generated) . replace t_gdpc = 1 if t_lgdp < 6.008 & t_lgdp~= .; (5701 real changes made) . replace t_gdpc = 2 if 6.008<= t_lgdp & t_lgdp < 7.301 ; (5251 real changes made) . replace t_gdpc = 3 if 7.301 <= t_lgdp & t_lgdp < 8.517 ; (5850 real changes made) . replace t_gdpc = 4 if t_lgdp >= 8.517 & t_lgdp~= . ; (5700 real changes made) . gene g11 = (o_gdpc==1 & t_gdpc==1) if o_lgdp~=. & t_lgdp~=. ; (353 missing values generated) . gene g12 = (o_gdpc==1 & t_gdpc==2) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g13 = (o_gdpc==1 & t_gdpc==3) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g14 = (o_gdpc==1 & t_gdpc==4) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g21 = (o_gdpc==2 & t_gdpc==1) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g22 = (o_gdpc==2 & t_gdpc==2) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g23 = (o_gdpc==2 & t_gdpc==3) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g24 = (o_gdpc==2 & t_gdpc==4) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g31 = (o_gdpc==3 & t_gdpc==1) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g32 = (o_gdpc==3 & t_gdpc==2) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g33 = (o_gdpc==3 & t_gdpc==3) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g34 = (o_gdpc==3 & t_gdpc==4) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g41 = (o_gdpc==4 & t_gdpc==1) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g42 = (o_gdpc==4 & t_gdpc==2) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g43 = (o_gdpc==4 & t_gdpc==3) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene g44 = (o_gdpc==4 & t_gdpc==4) if o_lgdp~=. & t_lgdp~=.; (353 missing values generated) . gene civ33 = (o_civr<=2.5 & t_civr<=2.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ32 = (o_civr<=2.5 & t_civr>2.5 & t_civr<4.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ31 = (o_civr<=2.5 & t_civr>=4.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ23 = (o_civr>2.5 & o_civr<4.5 & t_civr<=2.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ22 = (o_civr>2.5 & o_civr<4.5 & t_civr>2.5 & t_civr<4.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ21 = (o_civr>2.5 & o_civr<4.5 & t_civr>=4.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ13 = (o_civr>=4.5 & t_civr<=2.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ12 = (o_civr>=4.5 & t_civr>2.5 & t_civr<4.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . gene civ11 = (o_civr>=4.5 & t_civr>=4.5) if o_civr~=. & t_civr~=. ; (947 missing values generated) . drop if origin=="Israel" | affected=="Israel" ; (300 observations deleted) . * col 1; . nbreg count d o_lpop o_lgdp t_lpop t_lgdp, disp(constant) cluster(origin) ; Fitting Poisson model: Iteration 0: log pseudolikelihood = -2756.9867 Iteration 1: log pseudolikelihood = -2626.3381 Iteration 2: log pseudolikelihood = -2625.6978 Iteration 3: log pseudolikelihood = -2625.6972 Iteration 4: log pseudolikelihood = -2625.6972 Fitting constant-only model: Iteration 0: log pseudolikelihood = -1809.9941 Iteration 1: log pseudolikelihood = -1562.8301 Iteration 2: log pseudolikelihood = -1561.5823 Iteration 3: log pseudolikelihood = -1561.5814 Iteration 4: log pseudolikelihood = -1561.5814 Fitting full model: Iteration 0: log pseudolikelihood = -1561.5814 Iteration 1: log pseudolikelihood = -1349.822 Iteration 2: log pseudolikelihood = -1274.1033 Iteration 3: log pseudolikelihood = -1269.1037 Iteration 4: log pseudolikelihood = -1269.0875 Iteration 5: log pseudolikelihood = -1269.0875 Negative binomial regression Number of obs = 22052 Dispersion = constant Wald chi2(5) = 371.64 Log pseudolikelihood = -1269.0875 Prob > chi2 = 0.0000 (Std. Err. adjusted for 149 clusters in origin) ------------------------------------------------------------------------------ | Robust count | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- d | -.2617778 .0490022 -5.34 0.000 -.3578202 -.1657353 o_lpop | .4181485 .0901947 4.64 0.000 .2413701 .5949268 o_lgdp | -.2447351 .0898169 -2.72 0.006 -.4207731 -.0686972 t_lpop | .6942358 .0585706 11.85 0.000 .5794396 .8090319 t_lgdp | .6355564 .0435576 14.59 0.000 .550185 .7209278 _cons | -24.71056 1.918673 -12.88 0.000 -28.47109 -20.95003 -------------+---------------------------------------------------------------- /lndelta | 1.83547 .6327263 .5953494 3.075591 -------------+---------------------------------------------------------------- delta | 6.268081 3.96598 1.813665 21.66268 ------------------------------------------------------------------------------ . nbreg count d o_lpop o_lgdp t_lpop t_lgdp ; Fitting Poisson model: Iteration 0: log likelihood = -2756.9867 Iteration 1: log likelihood = -2626.3381 Iteration 2: log likelihood = -2625.6978 Iteration 3: log likelihood = -2625.6972 Iteration 4: log likelihood = -2625.6972 Fitting constant-only model: Iteration 0: log likelihood = -3136.4869 (not concave) Iteration 1: log likelihood = -1568.1944 Iteration 2: log likelihood = -1561.5942 Iteration 3: log likelihood = -1561.5814 Iteration 4: log likelihood = -1561.5814 Fitting full model: Iteration 0: log likelihood = -1510.7771 (not concave) Iteration 1: log likelihood = -1339.1349 Iteration 2: log likelihood = -1253.2331 Iteration 3: log likelihood = -1245.1798 Iteration 4: log likelihood = -1244.9965 Iteration 5: log likelihood = -1244.9963 Iteration 6: log likelihood = -1244.9963 Negative binomial regression Number of obs = 22052 LR chi2(5) = 633.17 Dispersion = mean Prob > chi2 = 0.0000 Log likelihood = -1244.9963 Pseudo R2 = 0.2027 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- d | -.420665 .0396511 -10.61 0.000 -.4983797 -.3429504 o_lpop | .7219022 .0704534 10.25 0.000 .5838161 .8599883 o_lgdp | -.3437438 .0613232 -5.61 0.000 -.463935 -.2235526 t_lpop | .8419052 .0556218 15.14 0.000 .7328884 .950922 t_lgdp | .7430764 .0573866 12.95 0.000 .6306008 .8555521 _cons | -32.5877 1.697396 -19.20 0.000 -35.91454 -29.26087 -------------+---------------------------------------------------------------- /lnalpha | 3.233686 .1172128 3.003953 3.463419 -------------+---------------------------------------------------------------- alpha | 25.37301 2.974042 20.16509 31.92594 ------------------------------------------------------------------------------ Likelihood-ratio test of alpha=0: chibar2(01) = 2761.40 Prob>=chibar2 = 0.000 . * col 2; . nbreg count d o_lpop o_lgdp o_civr t_lpop t_lgdp t_civr, disp(constant) cluster(origin); Fitting Poisson model: Iteration 0: log pseudolikelihood = -2631.6311 Iteration 1: log pseudolikelihood = -2408.4992 Iteration 2: log pseudolikelihood = -2405.5852 Iteration 3: log pseudolikelihood = -2405.5753 Iteration 4: log pseudolikelihood = -2405.5753 Fitting constant-only model: Iteration 0: log pseudolikelihood = -1799.5359 Iteration 1: log pseudolikelihood = -1551.514 Iteration 2: log pseudolikelihood = -1550.2621 Iteration 3: log pseudolikelihood = -1550.2611 Iteration 4: log pseudolikelihood = -1550.2611 Fitting full model: Iteration 0: log pseudolikelihood = -1550.2611 Iteration 1: log pseudolikelihood = -1329.1572 Iteration 2: log pseudolikelihood = -1249.3248 Iteration 3: log pseudolikelihood = -1245.2747 Iteration 4: log pseudolikelihood = -1245.2675 Iteration 5: log pseudolikelihood = -1245.2675 Negative binomial regression Number of obs = 21462 Dispersion = constant Wald chi2(7) = 362.38 Log pseudolikelihood = -1245.2675 Prob > chi2 = 0.0000 (Std. Err. adjusted for 147 clusters in origin) ------------------------------------------------------------------------------ | Robust count | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- d | -.254444 .0475814 -5.35 0.000 -.3477018 -.1611862 o_lpop | .3946756 .1010967 3.90 0.000 .1965297 .5928216 o_lgdp | -.0850244 .0993698 -0.86 0.392 -.2797857 .1097369 o_civr | .2511741 .0925012 2.72 0.007 .069875 .4324731 t_lpop | .691667 .056354 12.27 0.000 .5812152 .8021189 t_lgdp | .5018877 .0533767 9.40 0.000 .3972712 .6065041 t_civr | -.1673878 .063934 -2.62 0.009 -.2926961 -.0420796 _cons | -24.87753 2.308413 -10.78 0.000 -29.40193 -20.35312 -------------+---------------------------------------------------------------- /lndelta | 1.833543 .63475 .5894559 3.07763 -------------+---------------------------------------------------------------- delta | 6.256013 3.971005 1.803007 21.7069 ------------------------------------------------------------------------------ . nbreg count d o_lpop o_lgdp o_civr t_lpop t_lgdp t_civr; Fitting Poisson model: Iteration 0: log likelihood = -2631.6311 Iteration 1: log likelihood = -2408.4992 Iteration 2: log likelihood = -2405.5852 Iteration 3: log likelihood = -2405.5753 Iteration 4: log likelihood = -2405.5753 Fitting constant-only model: Iteration 0: log likelihood = -3114.272 (not concave) Iteration 1: log likelihood = -1557.3613 Iteration 2: log likelihood = -1550.2759 Iteration 3: log likelihood = -1550.2611 Iteration 4: log likelihood = -1550.2611 Fitting full model: Iteration 0: log likelihood = -1502.1235 (not concave) Iteration 1: log likelihood = -1324.7956 Iteration 2: log likelihood = -1317.9514 Iteration 3: log likelihood = -1234.0045 Iteration 4: log likelihood = -1213.2032 Iteration 5: log likelihood = -1212.3146 Iteration 6: log likelihood = -1212.313 Iteration 7: log likelihood = -1212.313 Negative binomial regression Number of obs = 21462 LR chi2(7) = 675.90 Dispersion = mean Prob > chi2 = 0.0000 Log likelihood = -1212.313 Pseudo R2 = 0.2180 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- d | -.4151195 .0396867 -10.46 0.000 -.492904 -.3373351 o_lpop | .7097064 .0702774 10.10 0.000 .5719652 .8474476 o_lgdp | -.0840912 .0739131 -1.14 0.255 -.2289582 .0607757 o_civr | .4201057 .069428 6.05 0.000 .2840292 .5561822 t_lpop | .8326495 .0561092 14.84 0.000 .7226775 .9426216 t_lgdp | .5155276 .0817254 6.31 0.000 .3553488 .6757064 t_civr | -.2874663 .0760799 -3.78 0.000 -.4365802 -.1383524 _cons | -33.17353 2.017394 -16.44 0.000 -37.12755 -29.21951 -------------+---------------------------------------------------------------- /lnalpha | 3.108146 .11772 2.877419 3.338873 -------------+---------------------------------------------------------------- alpha | 22.37951 2.634516 17.76835 28.18734 ------------------------------------------------------------------------------ Likelihood-ratio test of alpha=0: chibar2(01) = 2386.52 Prob>=chibar2 = 0.000 . * col 3; . nbreg count d trade diffrel o_lpop o_lgdp o_civr o_muslim o_budhist o_hindu o_other o_femil occupied t_lpop t_lgdp t_civr occupier, disp(constant) cluster(origin) > ; Fitting Poisson model: Iteration 0: log pseudolikelihood = -2214.3372 Iteration 1: log pseudolikelihood = -1883.8623 Iteration 2: log pseudolikelihood = -1763.6611 Iteration 3: log pseudolikelihood = -1755.4345 Iteration 4: log pseudolikelihood = -1754.4387 Iteration 5: log pseudolikelihood = -1754.4363 Iteration 6: log pseudolikelihood = -1754.4363 Fitting constant-only model: Iteration 0: log pseudolikelihood = -1684.5541 Iteration 1: log pseudolikelihood = -1440.3999 Iteration 2: log pseudolikelihood = -1439.1691 Iteration 3: log pseudolikelihood = -1439.1681 Iteration 4: log pseudolikelihood = -1439.1681 Fitting full model: Iteration 0: log pseudolikelihood = -1439.1681 Iteration 1: log pseudolikelihood = -1215.4831 Iteration 2: log pseudolikelihood = -1114.1281 Iteration 3: log pseudolikelihood = -1111.1738 Iteration 4: log pseudolikelihood = -1111.1595 Iteration 5: log pseudolikelihood = -1111.1595 Negative binomial regression Number of obs = 17802 Dispersion = constant Wald chi2(16) = 790.21 Log pseudolikelihood = -1111.1595 Prob > chi2 = 0.0000 (Std. Err. adjusted for 129 clusters in origin) ------------------------------------------------------------------------------ | Robust count | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- d | -.233102 .0463993 -5.02 0.000 -.324043 -.142161 trade | -.7503064 .6508888 -1.15 0.249 -2.026025 .5254123 diffrel | -.5997977 .2393105 -2.51 0.012 -1.068838 -.1307578 o_lpop | .6143637 .1078836 5.69 0.000 .4029157 .8258117 o_lgdp | -.1887112 .1529989 -1.23 0.217 -.4885837 .1111612 o_civr | .2704179 .1238588 2.18 0.029 .0276591 .5131768 o_muslim | -.0284798 .6407794 -0.04 0.965 -1.284384 1.227425 o_budhist | -1.41675 1.010861 -1.40 0.161 -3.398001 .564502 o_hindu | -2.475172 1.003321 -2.47 0.014 -4.441645 -.5086999 o_other | -3.026152 1.668688 -1.81 0.070 -6.29672 .2444161 o_femil | -.0021063 .0097791 -0.22 0.829 -.021273 .0170604 occupied | .2233334 .5234679 0.43 0.670 -.8026448 1.249312 t_lpop | .6462017 .0558324 11.57 0.000 .5367722 .7556313 t_lgdp | .4983243 .0611056 8.16 0.000 .3785596 .6180889 t_civr | -.1748011 .0610923 -2.86 0.004 -.2945399 -.0550624 occupier | .5851026 .2235975 2.62 0.009 .1468596 1.023346 _cons | -26.41101 2.637084 -10.02 0.000 -31.5796 -21.24242 -------------+---------------------------------------------------------------- /lndelta | 1.811648 .6752018 .4882768 3.135019 -------------+---------------------------------------------------------------- delta | 6.120526 4.13259 1.629506 22.98908 ------------------------------------------------------------------------------ . test o_muslim o_budhist o_hindu o_other ; ( 1) [count]o_muslim = 0 ( 2) [count]o_budhist = 0 ( 3) [count]o_hindu = 0 ( 4) [count]o_other = 0 chi2( 4) = 12.35 Prob > chi2 = 0.0149 . end of do-file . log close log: C:\Documents and Settings\alan\My Documents\terrorism\Web for RL\appendix2_1.log log type: text closed on: 18 May 2007, 12:07:58 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------