* dov4.do log using "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/logv1.smcl" cd "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR" * First, work on the file that contains all forced migrants (refugees, IDPs and asylum seekers) use "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/UNHCRAllmergedv3.dta" *Keep in mind the below if you come accross in the files: *Anything that starts with "str" is a string and anything else is a number. *If you see that a variable that is supposed to be numeric has a storage type that starts with "str" you know Stata's messed up. *Then you will need to fiddle with your text file to get it right. *start exploring the variables. If you add variables later on, remember to repeat these steps. describe *There are no strings so proceed *Declare data to be time series sort country year tsset country year save "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/UNHCRAllmergedv1.dta", replace sum *Multiple linear regression assumptions: *Assumption 1: dependent variable should be measured at the continuous level. *The DV is the net number of displaced, which can be considered as count data. Count data are highly non-normal and are not well estimated by OLS regression. *Assumption 2: there are two or more independent variables, which should be measured at the continuous or categorical level. *nkill or mortality rate are examples of this. *Assumption 3: there has to be a linear relationship between (a) the dependent variable and each of the independent variables, *and (b) the dependent variable and the independent variables collectively. scatter netdisplaced nkill, mlabel(country) *652 and 645 stand out scatter netdisplaced religiousdispersion, mlabel(country) *652 stands out scatter netdisplaced gdppercapitagrowth, mlabel(country) *645, 100, 346, 450, 411 stand out scatter netdisplaced unemployment, mlabel(country) *100, 645, 222, 343 stand out scatter netdisplaced inflation, mlabel(country) *100, 490, 552 stand out scatter netdisplaced gini, mlabel(country) *100, 490 scatter netdisplaced povertyratio, mlabel(country) *100, 490, 645, 700 scatter netdisplaced populationcountry, mlabel(country) *652 scatter netdisplaced gdppercapita, mlabel(country) *100 scatter netdisplaced undpaid, mlabel(country) *652, 100, 700 scatter netdisplaced unaid, mlabel(country) *700, 652 scatter netdisplaced popinslums, mlabel(country) *652, 100, 645, 700 scatter netdisplaced imfcredit, mlabel(country) *652, 100 scatter netdisplaced employment, mlabel(country) *100 scatter netdisplaced internet, mlabel(country) *652, 100 scatter netdisplaced literacy, mlabel(country) *652, 100, 645, 700 scatter netdisplaced povertygap, mlabel(country) *100, 490, 645, 700 scatter netdisplaced peacekeepers, mlabel(country) *652 scatter netdisplaced ruralpop, mlabel(country) *652, 100 scatter netdisplaced ruralpoverty, mlabel(country) *100, 490, 645 scatter netdisplaced unemploymentbasicedu, mlabel(country) *100 scatter netdisplaced unemploymentadvanceedu, mlabel(country) *100 scatter netdisplaced urbanpopulationpercent, mlabel(country) *652, 100, 700 scatter netdisplaced urbanpopulation, mlabel(country) *652, 100, 700 scatter netdisplaced povertyratio, mlabel(country) *100, 490, 645 scatter netdisplaced urbanpoverty, mlabel(country) *100, 490, 645, 700 scatter netdisplaced vulnerable employment, mlabel(country) *100, 475, 700 scatter netdisplaced mortalityrate, mlabel(country) *652, 100, 700 scatter netdisplaced fertility, mlabel(country) *100, 652 scatter netdisplaced ethnicdispersion, mlabel(country) *100, 652, 700 scatter netdisplaced totaldth, mlabel(country) *100, 645, 700 scatter netdisplaced deathciv, mlabel(country) *100, 700 scatter netdisplaced freedom, mlabel(country) *652, 100 *Scatterplots above show non-linear relationships. *Assumption #4: There should be no significant outliers, high leverage points or highly influential points, which represent observations *in the data set that are in some way unusual. These can have a very negative effect on the regression equation that is used to predict *the value of the dependent variable based on the independent variables. *Main outliers: *100: Columbia *700: Afghanistan *645: Iraq *652: Syria *I'd like to keep them, I'll run the models with and without them and report both results. *Assumption #5: the data needs to show homoscedasticity, which is where the variances along the line of best fit remain similar *as you move along the line. Check for homoscedasticity in Stata by plotting the residuals against the unstandardized predicted values. *If the model is well-fitted, there should be no pattern to the residuals plotted against the fitted values. If the variance of the *residuals is non-constant then the residual variance is said to be “heteroscedastic". regress netdisplaced nkill religiousdispersion gdppercapitagrowth freedom ethnicdispersion rvfplot *There is some heteroskedasticity. *Assumption #7: The data must not show multicollinearity, which occurs when you have two or more independent variables that are highly *correlated with each other. Can check this assumption in Stata through an inspection of correlation coefficients and Tolerance/VIF values. *Can use the vif command after the regression to check for multicollinearity. vif stands for variance inflation factor. As a rule of thumb, *a variable whose VIF values are greater than 10 may merit further investigation. Tolerance, defined as 1/VIF, is used by many researchers *to check on the degree of collinearity. A tolerance value lower than 0.1 is comparable to a VIF of 10. It means that the variable could be *considered as a linear combination of other independent variables. *testing multicollinearity with some possible regressions: regress netdisplaced nkill religiousdispersion gdppercapitagrowth unemployment mortalityrate ethnicdispersion freedom vif *multicollinearity not an issue regress netdisplaced gdppercapitagrowth unemployment inflation gini povertyratio populationcountry undpaid imfcredit internet literacy povertygap *poverty related variables should be used carefully as similar ones would cause multicollinearity issues as shown in this regression. *Otherwise, multicollinearity is not an issue in the data. *Assumption #7: Although normality of residuals is not a requirement of multiple regression, OLS requires that the residuals (errors) *should be approximately normally distributed. *a possible regression could look as the below (the graph saved as normalitycheck1): regress netdisplaced nkill religiousdispersion gdppercapitagrowth unemployment mortalityrate ethnicdispersion freedom predict r, resid kdensity r, normal *The pnorm command graphs a standardized normal probability (P-P) plot while qnorm plots the quantiles of a variable against the quantiles *of a normal distribution. pnorm is sensitive to non-normality in the middle range of data and qnorm is sensitive to non-normality near the *tails. pnorm r *saved as normalitycheckpnorm1 qnorm r *saved as normalitycheckqnorm1 *clearly residuals are not normally distributed. *Assumption 9: I should have independence of observations (i.e., independence of residuals), which I check in Stata using the Durbin-Watson *statistic. This assumption means that the errors associated with one observation are not correlated with the errors of any other observation. *Durbin-Watson tests are for serial autocorrelation. Autocorrelation is a characteristic of data in which the correlation *between the values of the same variables is based on related objects.Serial autocorrelation is defined only for a time series, so this test *is appropriate for my data. *Durbin-Watson test: *Sample regression 1: regress netdisplaced nkill religiousdispersion gdppercapitagrowth unemployment mortalityrate ethnicdispersion freedom *dwstat (Durbin-Watson test) does not work with this data because it is only for single time series. *Whereas my data is cross- sectional time-series data so I have to use different tests. *Typically, fixed effects and/or random effects are useful to analyze panel data.The command to run for these effects is xtreg. *Before using xtreg I need to set Stata to handle panel data by using the command xtset. xtset country year *The note “(country unbalanced)” refers to the fact that some countries do not have data for some years, which then means the data is *unbalanced. But this does not prevent models being run with the data. *Serial correlation tests apply to macro panels with long time series (over 20-30 years). Not a problem in micro panels (with very few years). *Serial correlation causes the standard errors of the coefficients to be smaller than they actually are and higher R-squared. *A Lagram-Multiplier test for serial correlation is available using the command xtserial. xtserial netdisplaced nkill religiousdispersion gdppercapitagrowth unemployment mortalityrate ethnicdispersion freedom *The null is no serial correlation. Here, I strongly reject the null hypothesis of no serial correlation. If there is serial correlation in *the idiosyncratic error term, clustering at the panel level will produce consistent estimates of the standard errors, and as discussed by *Baltagi (2001) and Wooldridge (2002), other estimators will produce more efficient estimates. I will keep this in mind when I build my models. *The data is clearly cross-sectional time series, so OLS regression would not be appropriate, but also the violations of the above OLS *assumptions also require using another type of regression and the Lagram-Multiplier test points to the need of clustering when I run my *final models. *Which type of regression is suitable for the data? Main characteristics of my data: *1)DV is a count variable: linear regression is not an appropriate estimation technique for count data, as it fails to take into account *the limited number of possible values of the response variable. Net displaced people is a count data, only taking on nonnegative (or only positive) integer values. *For count DVs the typically used regression is Poisson. *2)The data is overdispersed as demonstrated later on in this do file. A limitation of the Poisson distribution is the equality of its mean *and variance. We may often observe count data processes where this equality is not reasonable: in particular, where the conditional *variance is larger than the conditional mean. This is termed overdispersion, and its presence renders the assumption of a Poisson distribution *for the error process untenable. It is particularly likely to occur in the case of unobserved heterogeneity. a reasonable alternative is *negative binomial regression. This model allows the variance to differ from the mean. *3)Excessive '0's in the DV. A proper model is then zero-inflated negative binomial regression (with command zinb). With this type of *regression, there is an auxiliary logit model specified in the inflate()) option that determines whether the observed count is zero. *This model could contain only a constant or additional covariates. *With the vuong option, a test of the ZIP versus standard Poisson regression model is computed. For zinb, the zip option computes a test of *the zinb model versus the zero-inflated Poisson model which is nested within. See Modelsforcountdata file by Baum for more information and *the method for 0 truncated models. *4)Violates most of the OLS regression conditions. *Before specific poisson/binomial model is selected, below I determine which variables are to be lagged and logged, then build possible models *and finally test for model fit. *Count variable cannot be negative or fractional in these regressions, that is why it was important to truncate the negative values of the *DV to '0'. If I took these '0's out instead, that would produce selection bias. *Net displaced = DV will be lagged because *1)There may be a late response of t+1 for example, in the decision to move. Lagged DV here is a way to reflect this dynamism. *2)Using a lagged DV may capture autocorrelation. For example, it may be the case that a higher number of net displaced at t may cause higher *values at t+1 or t+2 because higher volumes of migration may trigger even larger number of people to move although there is at least one study *that looked into the time dependence and found that not to be the case. Including lagged dependent variables can reduce the occurrence of *autocorrelation arising from model misspecification. Thus accounting for lagged dependent variables helps to defend the existence of *autocorrelation in the model. The past value affects the present in the model, requires theoretical foundation, and best fit up the model *as per required.Insert citation and discuss. *Can run the models with lagged DV and normal DV to compare. *lag the DV: gen netdisplaced_L1 = L1.netdisplaced *some IVs may have lagged effects, too: gen gdppercapitagrowth_L1 = L1.gdppercapitagrowth gen unemployment_Lag1 = L1.unemployment *Note: there was a coding error while creating unemployment_L1 so a new var named unemployment_Lag1 was created. Se do4 for the error. gen povertyratio_L1 = L1.povertyratio *observing some variables: histogram gdppercapitagrowth_L1 histogram unemployment_Lag1 histogram inflation_L1 histogram nkill histogram religiousdispersion histogram ethnicdispersion histogram netdisplaced_L1 histogram netdisplaced *a good number of variables indicate overdispersion and right-skewedness, too. If this is the case when running the regression, too, *then it violates the condition for poisson regressions which assume mean-variance equality. NB regression relaxes this assumption so *is more appropriate. *I log some variables because the graphs I run in the beginning show some outliers and I aimed to ensure they did not *disproportionately influence the analysis. I did not omit the outliers because they are all important for the study of forced migration. *Exclusion of countries such as Afhanistan, Iraq, Syria and Columbia does not make sense for the purpose of the research. So where a variable *was lagged, I then also took its log if needed as below. For all the ZINB models, I include all independent lagged-conflict variables were *within both the zero inflation stage and count stage estimating equations. The justification for using these lagged covariates within *the inflation stage rests on the contention that recent levels of yearly net displacement (or lack thereof) directly inform us, with ex-ante *observability, as to which country-years are currently able to experience net displacement, and which are not. If correct, this strategy *will allow us to statistically partition our (potentially) ‘inflated zero’ cases from the true ‘count-zero’ conflict cases, and to *thereby improve the accuracy and precision of our count stage estimates and net displacement odds. I DONT GET THIS!!!! *'ln' before a variable indicated log transformation in literature. *H1: INTENSITY OF VIOLENCE INCREASES NET DISPLACED *The only variable that could be categorical in this regression would be Freedom House ratings, but because I converted levels of freedom *to a rating scale from 0 to 2, I decided to treat it as a continous variable. *DV: net displaced/netdisplaced_L1 *IV: nkill/deathciv/totaldth *CVs: gdppercapitagrowth religiousdispersion ethnicdispersion populationcountry unemployment freedom *Below is the analysis of each variable to decide to log/lag in the model. If have to do both, first lag, then log. histogram netdisplaced histogram netdisplaced_L1 scatter netdisplaced gdppercapitagrowth scatter netdisplaced nkill scatter netdisplaced deathciv scatter netdisplaced totaldth scatter netdisplaced religiousdispersion scatter netdisplaced ethnicdispersion scatter netdisplaced populationcountry scatter netdisplaced unemployment scatter netdisplaced freedom *Also using other ways to identify outliers in the DV to decide if I want to log it, too. As a result of the below, I decided to log the DV, too. fre netdisplaced totaldth, tabulate(3) sum netdisplaced totaldth extremes netdisplaced totaldth scatter netdisplaced totaldth fre netdisplaced_L1 totaldth, tabulate(3) sum netdisplaced_L1 totaldth extremes netdisplaced_L1 totaldth scatter netdisplaced_L1 totaldth *Consequently, I will log all the IVs CVs and the DV *I will lag economic variables gen lognetdisplaced = log(netdisplaced) gen lognetdisplaced_L1 = log(netdisplaced_L1) gen lognkill = log(nkill) gen logdeathciv = log(deathciv) gen logtotaldth = log(totaldth) gen = log() gen logfreedom = log(freedom) gen logreligiousdispersion = log(religiousdispersion) gen logethnicdispersion = log(ethnicdispersion) gen logpopulationcountry = log(populationcountry) gen loggdppercapitagrowth_L1 = log(gdppercapitagrowth_L1) gen logunemployment_Lag1 = log(unemployment_Lag1) gen logurbanpopulation = log(urbanpopulation) gen logpopinslums = log(popinslums) *trying different models for H1: zinb lognetdisplaced lognkill, inflate(lognkill) zinb lognetdisplaced lognkill loggdppercapitagrowth_L1, inflate(lognkill loggdppercapitagrowth_L1) zinb lognetdisplaced lognkill loggdppercapitagrowth_L1, inflate(lognkill loggdppercapitagrowth_L1) * is causing a problem, need to investigate zinb lognetdisplaced lognkill logfreedom loggdppercapitagrowth_L1, inflate(lognkill logfreedom loggdppercapitagrowth_L1) *logfreedom is causing a problem, need to investigate zinb lognetdisplaced lognkill loggdppercapitagrowth_L1 logreligiousdispersion, inflate(lognkill loggdppercapitagrowth_L1 logreligiousdispersion) zinb lognetdisplaced lognkill loggdppercapitagrowth_L1 logreligiousdispersion logethnicdispersion, inflate(lognkill loggdppercapitagrowth_L1 logreligiousdispersion logethnicdispersion) zinb lognetdisplaced lognkill loggdppercapitagrowth_L1 logethnicdispersion, inflate(lognkill loggdppercapitagrowth_L1 logethnicdispersion) zinb lognetdisplaced lognkill loggdppercapitagrowth_L1, inflate(lognkill loggdppercapitagrowth_L1) zinb lognetdisplaced logdeathciv, inflate(logdeathciv) zinb lognetdisplaced logdeathciv loggdppercapitagrowth_L1, inflate(logdeathciv loggdppercapitagrowth_L1) zinb lognetdisplaced logtotaldth, inflate(logtotaldth) zinb lognetdisplaced lognkill loggdppercapitagrowth_L1 logfreedom logreligiousdispersion logethnicdispersion logpopulationcountry, inflate(lognkill loggdppercapitagrowth_L1 logfreedom logreligiousdispersion logethnicdispersion logpopulationcountry) vuong *checking normality of variables again with kernel density to determine if I want to log them. In literature, typically, population and *GDP have been logged and I may do just the same, but have to check and confirm first. regress netdisplaced deathciv ethnicdispersion freedom gdppercapitagrowth religiousdispersion totaldth populationcountry unemployment kdensity unemployment, normal kdensity netdisplaced, normal *should be logged kdensity deathciv, normal *should be logged kdensity ethnicdispersion, normal kdensity freedom, normal kdensity gdppercapitagrowth, normal kdensity religiousdispersion, normal kdensity totaldth, normal *should be logged kdensity , normal *should be logged kdensity populationcountry, normal *should be logged kdensity unaid, normal *should be logged gen logunaid = log(unaid) *Possible regression for H1: intensity of violence and net displaced zinb lognetdisplaced logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry, inflate(logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry) zinb lognetdisplaced logtotaldth, inflate(logtotaldth) zinb netdisplaced totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion populationcountry, inflate(totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion populationcountry) zinb netdisplaced totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion populationcountry, inflate(totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion populationcountry) zinb netdisplaced totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion populationcountry, inflate(totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion populationcountry) zinb netdisplaced totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry, inflate(totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry) zinb lognetdisplaced totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry, inflate(totaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry) zinb netdisplaced logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry, inflate(logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry) *zinb does not work with lognetdisplaced zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry, inflate(logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry) *running with robust standard errors zinb netdisplaced logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry, inflate(logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry) robust zinb netdisplaced logtotaldth ethnicdispersion freedom vulnerableemployment religiousdispersion logpopulationcountry, inflate(logtotaldth ethnicdispersion freedom vulnerableemployment religiousdispersion logpopulationcountry) robust zinb netdisplaced logtotaldth ethnicdispersion freedom gini religiousdispersion logpopulationcountry, inflate(logtotaldth ethnicdispersion freedom religiousdispersion logpopulationcountry) robust zinb netdisplaced logtotaldth ethnicdispersion freedom gini religiousdispersion logpopulationcountry, inflate(logtotaldth ethnicdispersion freedom gini religiousdispersion logpopulationcountry) robust zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion logpopulationcountry log, inflate(logtotaldth ethnicdispersion freedom religiousdispersion logpopulationcountry log) robust zinb lognetdisplaced logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry , inflate(logtotaldth ethnicdispersion freedom gdppercapitagrowth religiousdispersion logpopulationcountry ) *regression with political violence for all migrants with totaldth: zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion, inflate(logtotaldth ethnicdispersion freedom religiousdispersion) robust zinb, irr estimates store zinb poisson netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion estimates stats pois zinb zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion , inflate(logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *controlling for region: zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i.region) robust *controlling for Africa (1) zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i1.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion i1.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr *controllin for Asia (2) zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i2.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion i2.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr *controlling for Europe (3) zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i3.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion i3.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr *controlling for N. America (4) zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i4.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion i4.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr *controlling for S. America (5) zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i5.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion i5.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr *controlling for ME (6) zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i6.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion i6.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr *controlling for Oceania (7) zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i7.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion i7.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr *netdisplaced_L1 is not making a siginificant change so in the main text, I will not include it and use netdisplaced as the only DV. *regression with social/economic variables for all migrants with totaldth: zinb netdisplaced unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust zinb, irr *without gdppercapitagrowth zinb netdisplaced unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with interactions: zinb netdisplaced c.gdppercapitagrowth_L1##c.religiousdispersion c.gdppercapitagrowth_L1##c.logtotaldth unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom , inflate(unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust *When GDPpercapitagrowth increases by one unit, the effect of religious dispersion decreases by a factor of 0.75 (or 25%). *interaction1: GDPpercapitagrowth&religiousdispersion zinb netdisplaced unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom c.gdppercapitagrowth_L1##c.religiousdispersion, inflate(gdppercapitagrowth_L1 unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust margins, at(gdppercapitagrowth_L1 = (-10 -5 0 ) religiousdispersion = (0.10 0.20 0.30)) marginsplot, name(predicted_outcomes, replace) *estimate marginal effect margins, dydx(gdppercapitagrowth_L1) at (religiousdispersion = (0.10 0.60)) marginsplot, name(gdppercapitagrowthL1ME, replace) margins, dydx(religiousdispersion) at(gdppercapitagrowth_L1 = (-10 2)) marginsplot, name(religiousdispersionME, replace) *interaction2: GDPpercapitagrowth&logtotaldth zinb netdisplaced c.gdppercapitagrowth_L1##c.logtotaldth unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(gdppercapitagrowth_L1 unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion) robust margins, at(gdppercapitagrowth_L1 = (-3 2) logtotaldth = (3 5)) marginsplot *interaction3: povertyratio&totaldeath zinb netdisplaced c.povertyratio_L1##c.logtotaldth unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(gdppercapitagrowth_L1 unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion) robust margins, at(povertyratio_L1 = (20 21 22 23) logtotaldth = (3 3.5 4 4.5)) marginsplot *interaction4: gini&totaldeath zinb netdisplaced c.povertyratio_L1##c.logtotaldth unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(gdppercapitagrowth_L1 unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion) robust margins, at(povertyratio_L1 = (20 25) logtotaldth = (3 5)) marginsplot *Graph the following significant interactions to decide which ones to add to the economic models: *GDPpercapitagrowth & religious dispersion *GDPpercapitagrowth & totaldth *povertyratio & religious dispersion *povertyratio & logtotaldth *poveryratio & freedom *povertyratio & logurbanpopulation *povertyratio & logtotaldth *gini_L & freedom *gini_L1 & ethnicdispersion *gini_L1 & logurbanpopulation *gini_L1 & logtotaldeath *Create a dummy variable for GDPpercapitagrowth. sum GDPpercapitagrowth *I call values above the mean high (1) and values below the mean (0). The mean is about 1.94. generate gdppercapitagrowthdummy = 0 replace gdppercapitagrowthdummy = 1 if gdppercapitagrowth_L1>1.94 replace gdppercapitagrowthdummy = . if missing(gdppercapitagrowth_L1) *Sample from Stataforum: zip complaints other_covariates c.Level1##c.SD1 c.Level2##c.SD2 c.Level3##c.SD3, inflate(inflate_model_variables) margins, at(Level1 = (interesting_values_of_Level1) SD1 = (interesting_values_of_SD1)) marginsplot, name(predicted_outcomes, replace) margins, dydx(Level1) at (SD1 = (interesting_values_of_SD1)) marginsplot, name(level1_marginal_effects, replace) margins, dydx(SD1) at(Level1 = (interesting_values_of_Level1)) marginsplot, name(sd1_marginal_effects, replace) *Example Margins, determining interesting values for VAR between 20 and 70. at(age=(20 70)) *with region zinb netdisplaced unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region, inflate(unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i2.region, inflate(unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i3.region, inflate(unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i4.region, inflate(unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i5.region, inflate(unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i6.region, inflate(unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i7.region, inflate(unemployment logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(unemployment_Lag1 logtotaldth logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with political violence for all migrants with deathciv: zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion, inflate(logdeathciv ethnicdispersion freedom religiousdispersion) robust zinb, irr *with region zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i1.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i2.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i3.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i4.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i5.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i6.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i7.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logdeathciv ethnicdispersion freedom religiousdispersion , inflate(logdeathciv ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with social/economic variables for all migrants with deathciv: zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion) robust zinb, irr *regression with unemployment_Lag1 does continues to run indefinitely with 'iteration backed up' message. As advised by STATA, I've tried to *run the regression with 'difficult' command instead of robust to use a different stepping algorithm in nonconcave regions, but this did not work. *I have then asked STATA to use a different technique than the default Newton-Raphson maximization algorithm; this did not work, either. Finally, *I have limited the number of iterations (to the default 16,000 set by STATA). This did not work, either. The recommendation by STATA in a case like this *is to remove the variable that is causing the problem. I have therefore removed unemployment_Lag1 from civiliandeaths regressions. *dropping gdppercapitagrowth zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion) robust zinb, irr *not working, dropping unemployment_Lag1 zinb netdisplaced logdeathciv logurbanpopulation ethnicdispersion freedom religiousdispersion, inflate(logdeathciv logurbanpopulation ethnicdispersion freedom religiousdispersion) robust zinb, irr *with regions: zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with political violence for all migrants with nkill: zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion, inflate(lognkill ethnicdispersion freedom religiousdispersion) robust zinb, irr *with region zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i1.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i2.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i3.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i4.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i5.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i6.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i7.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 lognkill ethnicdispersion freedom religiousdispersion , inflate(lognkill ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with social/economic variables for all migrants with nkill: zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion) robust zinb, irr *dropping GDPpercapitagrowth zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i2.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i3.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i4.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i5.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i6.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i7.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion ) robust zinb, irr zinb netdisplaced_L1 lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust *Preparing REFUGEES file for regressions: drop if year < 1970 sort country year tsset country year save xtset country year *regression with political violence for refugees with totaldth: zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion , inflate(logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions: zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i1.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i2.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i3.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i4.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i5.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i6.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i7.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion , inflate(logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with social/economic variables for refugees with totaldth: zinb netdisplaced loggdppercapitagrowth_L1 unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion , inflate(loggdppercapitagrowth_L1 unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i1.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i2.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i3.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i4.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i5.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i6.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i7.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion , inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with political violence for refugees with deathciv: zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion , inflate(logdeathciv ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions: zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i1.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i2.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i3.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i4.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i5.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i6.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i7.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logdeathciv ethnicdispersion freedom religiousdispersion , inflate(logdeathciv ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with social/economic variables for refugees with deathciv: zinb netdisplaced logdeathciv loggdppercapitagrowth_L1 logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(logdeathciv loggdppercapitagrowth_L1 logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with political violence for refugees with nkill: zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion , inflate(lognkill ethnicdispersion freedom religiousdispersion ) robust zinb, irr *does not work zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i1.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i2.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i3.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i4.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i5.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i6.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i7.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 lognkill ethnicdispersion freedom religiousdispersion , inflate(lognkill ethnicdispersion freedom religiousdispersion ) robust *Does not work *regression with social/economic variables for refugees with nkill: zinb netdisplaced lognkill loggdppercapitagrowth_L1 unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(lognkill loggdppercapitagrowth_L1 unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust zinb, irr *Does not work *with regions zinb netdisplaced lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region, inflate(lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i2.region, inflate(lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i3.region, inflate(lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i4.region, inflate(lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i5.region, inflate(lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i6.region, inflate(lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i7.region, inflate(lognkill unemployment_Lag1 logurbanpopulation ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region, inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced_L1 lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion , inflate(lognkill logurbanpopulation ethnicdispersion freedom religiousdispersion ) robust *Does not work *Prepare IDP file for regressions drop if year < 1970 sort country year tsset country year save xtset country year *regression with political violence for IDPs with totaldth: zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion , inflate(logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i1.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i2.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i3.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i4.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i5.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i6.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logtotaldth ethnicdispersion freedom religiousdispersion i7.region, inflate(logtotaldth ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logtotaldth ethnicdispersion freedom religiousdispersion , inflate(logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with social/economic variables for IDPs with totaldth: zinb netdisplaced loggdppercapitagrowth_L1 unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion , inflate(loggdppercapitagrowth_L1 unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i1.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i2.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i3.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i4.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i5.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i6.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i7.region, inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion , inflate(unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with political violence for IDPs with deathciv: zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion , inflate(logdeathciv ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i1.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i2.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i3.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i4.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i5.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i6.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logdeathciv ethnicdispersion freedom religiousdispersion i7.region, inflate(logdeathciv ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logdeathciv ethnicdispersion freedom religiousdispersion , inflate(logdeathciv ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with social/economic variables for IDPs with deathciv: zinb netdisplaced logdeathciv loggdppercapitagrowth_L1 logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(logdeathciv loggdppercapitagrowth_L1 logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion) robust zinb, irr *with regions zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region, inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(logdeathciv logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with political violence for IDPs with nkill: zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion , inflate(lognkill ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions: zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i1.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i2.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i3.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i4.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i5.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i6.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced lognkill ethnicdispersion freedom religiousdispersion i7.region, inflate(lognkill ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 lognkill ethnicdispersion freedom religiousdispersion , inflate(lognkill ethnicdispersion freedom religiousdispersion ) robust zinb, irr *regression with social/economic variables for IDPs with nkill: zinb netdisplaced lognkill loggdppercapitagrowth_L1 logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(lognkill loggdppercapitagrowth_L1 logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion ) robust zinb, irr *with regions zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i1.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i2.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i3.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i4.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i5.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i6.region) robust zinb, irr zinb netdisplaced lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region, inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion i7.region) robust zinb, irr zinb netdisplaced_L1 lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion , inflate(lognkill logurbanpopulation unemployment_Lag1 ethnicdispersion freedom religiousdispersion ) robust zinb, irr *note: correctly categorize variables (put i. in front etc.) There is none here, the closest is freedom, but there is an order to its categories so I don't consider *it categorical. *H2: Countries with border disputes are more likely to produce forced migrants. *H3: The more lethal terrorism, the more forced migrants *For descriptive statistics table (in the all migrants file: sum netdisplaced netdisplaced_L1 logtotaldth lognkill logdeathciv gdppercapitagrowth povertyratio unemployment_Lag1 logurbanpopulation logtotaldth ethnicdispersion freedom religiousdispersion *Adding Eastern Bloc countries: *Created an excel file with all countries = 0 if they are not Eastern Bloc and = 1 if they are Eastern Bloc, converted to Stata and merged with the other files. *During the merge, there are unmatched data because I set the Eastern Bloc dates between 1970-2016, but the UNHCR file has some come countries' data *starting later than 1970. So there are no discrepancy issues. *Below are these steps and the updated files names: log using "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/logv1.smcl", append cd "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR" use "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/easternbloc.dta" describe sum merge 1:1 country year using "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/UNHCRAllmergedv2.dta" save "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/UNHCRAllmergedv3.dta" list if _merge==1 list if _merge==1 drop _merge save *repeat the above and save as below files for refugees and IDPs * UNHCRidpsmergedv2.dta * UNHCRrefugeesmergedv2.dta *Adding region log using "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/logv1.smcl", append cd "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR" import excel "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/COW/COWregions.xlsx", sheet("stata") firstrow save "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/COW/cowregionsstata.dta" file /Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/COW/cowregionsstata.dta saved merge 1:1 country year using "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/UNHCRAllmergedv3.dta" *repeat the above for refugees and IDPs merge 1:1 country year using "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/UNHCRrefugeesmergedv3.dta" import excel "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/COW/COWregions.xlsx", sheet("stata") firstrow save "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/COW/cowregionsstata.dta" file /Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/COW/cowregionsstata.dta saved merge 1:1 country year using "/Users/duyguozaltin/Desktop/Kent/Dissertation/DataLargen/UNHCR/UNHCRidpsmergedv3.dta" log close *run the regressions after adding region and eastern bloc variables *provide descriptive statistics: numbers by region