Hi Stata users,

During my undergraduate dissertation I have been learning how to use Stata. This resource has been exceptionally useful for answering a multitude of questions! However, I am struggling to find an answer to this particular question so I thought I would contribute to the forum.

I want to plot the impact of religious distance (reldist_weighted_WCD_migweight) on technology adoption (lcumulative_o_flow). From the results posted below, you will see that religious distance has a significant hump shaped impact on technology adoption, once controlled for country and year fixed effects and migration (lIV_level_stock). I want to plot the ceteris paribus effect of religious distance in a graph but am struggling to do so. The desired output is something similar to Ashraf and Galor's graph on page 30 where they use an augmented component-plus-residual plot to show the impact of (Predicted) Genetic homogeneity on log population density (https://www.aeaweb.org/articles?id=10.1257/aer.103.1.1)

So, after running my regression:

Code:
gen reldist_weighted_WCD_migweight2=reldist_weighted_WCD_migweight^2
xi: bootstrap, seed(12345) reps(100): reg lcumulative_o_flow lIV_level_stock reldist_weighted_WCD_migweight reldist_weighted_WCD_migweight2 i.year i.o_country if o_patoffice=="EPO_A"
I gained the results posted at the end of the question. I then proceeded to use acprplot command to attempt to plot this effect, however was met with the following message:
Code:
. acprplot reldist_weighted_WCD_migweight
reldist_weighted_WCD_migweight^2 is collinear with reldist_weighted_WCD_migweight
There is no issue of collinearity as one variable is the square of the other. How can I get round this issue to plot the results?

Any comments that you may have on the issue are welcome.

Many thanks,

Mattie


Code:
. xi: bootstrap, seed(12345) reps(100): reg lcumulative_o_flow lIV_level_stock reldist_weighted_WCD_mi
> gweight reldist_weighted_WCD_migweight2 i.year i.o_country if o_patoffice=="EPO_A"
i.year            _Iyear_1980-2011    (naturally coded; _Iyear_1980 omitted)
i.o_country       _Io_country_1-96    (_Io_country_1 for o_c~y==Algeria omitted)
(running regress on estimation sample)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
x...xx.x...xxx..xx......x.xxx..xx.x.x...x..x.x....    50
xxxxx...x.xx.x..xx.........x.......x.x.x.x..xxxxxx   100

Linear regression                               Number of obs     =      2,373
                                                Replications      =         58
                                                Wald chi2(57)     =          .
                                                Prob > chi2       =          .
                                                R-squared         =     0.9006
                                                Adj R-squared     =     0.8949
                                                Root MSE          =     1.0493

-------------------------------------------------------------------------------------------------
                                |   Observed   Bootstrap                         Normal-based
             lcumulative_o_flow |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------------------+----------------------------------------------------------------
                lIV_level_stock |   .0433186   .0073221     5.92   0.000     .0289675    .0576696
 reldist_weighted_WCD_migweight |   7.359744   .3721271    19.78   0.000     6.630388      8.0891
reldist_weighted_WCD_migweight2 |  -6.583357   .6132874   -10.73   0.000    -7.785378   -5.381336
                    _Iyear_1981 |  -.0674904   .2146398    -0.31   0.753    -.4881768    .3531959
                    _Iyear_1982 |   .0178493   .2837429     0.06   0.950    -.5382765    .5739751
                    _Iyear_1983 |   .3935321   .2537367     1.55   0.121    -.1037827     .890847
                    _Iyear_1984 |   .5352107   .2333929     2.29   0.022     .0777689    .9926524
                    _Iyear_1985 |   .4729476   .2358709     2.01   0.045     .0106491    .9352462
                    _Iyear_1986 |   .4256533   .2245722     1.90   0.058    -.0145001    .8658067
                    _Iyear_1987 |   .3569092   .2666282     1.34   0.181    -.1656724    .8794908
                    _Iyear_1988 |   .5028509   .2476099     2.03   0.042     .0175444    .9881573
                    _Iyear_1989 |   .5106573   .2313004     2.21   0.027     .0573168    .9639979
                    _Iyear_1990 |   .6233263   .2228631     2.80   0.005     .1865227     1.06013
                    _Iyear_1991 |   .7188436   .2138539     3.36   0.001     .2996976     1.13799
                    _Iyear_1992 |   .7808771   .2379217     3.28   0.001     .3145592    1.247195
                    _Iyear_1993 |   .7265691   .2206304     3.29   0.001     .2941414    1.158997
                    _Iyear_1994 |   .9045846    .239801     3.77   0.000     .4345833    1.374586
                    _Iyear_1995 |   .9959872   .2097023     4.75   0.000     .5849783    1.406996
                    _Iyear_1996 |   1.227218    .212677     5.77   0.000     .8103789    1.644057
                    _Iyear_1997 |    1.62892   .2226651     7.32   0.000     1.192505    2.065336
                    _Iyear_1998 |   1.349956   .2357112     5.73   0.000     .8879707    1.811941
                    _Iyear_1999 |    1.73312   .2162772     8.01   0.000     1.309225    2.157016
                    _Iyear_2000 |   1.957714   .2225118     8.80   0.000     1.521599    2.393829
                    _Iyear_2001 |   1.991195   .2228489     8.94   0.000     1.554419    2.427971
                    _Iyear_2002 |   1.680574   .2409684     6.97   0.000     1.208285    2.152864
                    _Iyear_2003 |   2.001597   .2245871     8.91   0.000     1.561415     2.44178
                    _Iyear_2004 |   2.108615   .2419064     8.72   0.000     1.634487    2.582743
                    _Iyear_2005 |   2.204265   .2125649    10.37   0.000     1.787646    2.620885
                    _Iyear_2006 |   2.014445   .2304086     8.74   0.000     1.562853    2.466038
                    _Iyear_2007 |   2.336512   .2175173    10.74   0.000     1.910186    2.762838
                    _Iyear_2008 |   2.315236   .2238853    10.34   0.000     1.876429    2.754044
                    _Iyear_2009 |   2.196182   .1960523    11.20   0.000     1.811927    2.580438
                    _Iyear_2010 |   2.225872   .2529522     8.80   0.000     1.730095    2.721649
                    _Iyear_2011 |   2.309962   .2218774    10.41   0.000      1.87509    2.744834
                  _Io_country_2 |   1.268477   .4919877     2.58   0.010     .3041991    2.232755
                  _Io_country_3 |   3.444388     .30816    11.18   0.000     2.840405     4.04837
                  _Io_country_4 |  -.0893468   .3204862    -0.28   0.780    -.7174882    .5387947
                  _Io_country_5 |   6.646548   .3144022    21.14   0.000     6.030331    7.262765
                  _Io_country_6 |   7.260963   .2663222    27.26   0.000     6.738982    7.782945
                  _Io_country_7 |   2.336293   .3133768     7.46   0.000     1.722085      2.9505
                  _Io_country_8 |   7.586078   .2795772    27.13   0.000     7.038117    8.134039
                  _Io_country_9 |   -.304022   .4799933    -0.63   0.526    -1.244792    .6367476
                 _Io_country_10 |   .7309615   .4492355     1.63   0.104    -.1495239    1.611447
                 _Io_country_11 |   4.597047   .2866138    16.04   0.000     4.035295      5.1588
                 _Io_country_12 |   2.689356    .349596     7.69   0.000     2.004161    3.374552
                 _Io_country_13 |   7.286705   .2957281    24.64   0.000     6.707088    7.866321
                 _Io_country_14 |   .5171735   .4199815     1.23   0.218     -.305975    1.340322
                 _Io_country_15 |   2.104829   .3050291     6.90   0.000     1.506983    2.702675
                 _Io_country_16 |   4.834861   .4218744    11.46   0.000     4.008003     5.66172
                 _Io_country_17 |   1.756597   .2645659     6.64   0.000     1.238057    2.275137
                 _Io_country_18 |   .4905027    .301507     1.63   0.104    -.1004401    1.081446
                 _Io_country_19 |   2.801754   .3286333     8.53   0.000     2.157644    3.445863
                 _Io_country_20 |   1.801246   .2913432     6.18   0.000     1.230224    2.372269
                 _Io_country_21 |    1.28167     .29458     4.35   0.000     .7043042    1.859037
                 _Io_country_22 |   4.146615   .3501905    11.84   0.000     3.460254    4.832976
                 _Io_country_23 |   6.552384   .2842844    23.05   0.000     5.995197    7.109571
                 _Io_country_24 |  -2.058116   .2730878    -7.54   0.000    -2.593358   -1.522874
                 _Io_country_25 |   .0742726   .3942984     0.19   0.851    -.6985382    .8470834
                 _Io_country_26 |   1.655048   .3032595     5.46   0.000     1.060671    2.249426
                 _Io_country_27 |    .799039   .3651613     2.19   0.029      .083336    1.514742
                 _Io_country_28 |   2.086525   .2883082     7.24   0.000     1.521451    2.651599
                 _Io_country_29 |   6.699462   .2908476    23.03   0.000     6.129412    7.269513
                 _Io_country_30 |   8.951348    .312096    28.68   0.000     8.339651    9.563045
                 _Io_country_31 |   .2544531   .3141573     0.81   0.418    -.3612839    .8701901
                 _Io_country_32 |   10.56494   .3560433    29.67   0.000     9.867109    11.26277
                 _Io_country_33 |   4.071337   .2891144    14.08   0.000     3.504684    4.637991
                 _Io_country_34 |  -.0779222   .5392577    -0.14   0.885    -1.134848    .9790034
                 _Io_country_35 |   4.989608   .3307975    15.08   0.000     4.341257    5.637959
                 _Io_country_36 |   5.097968   .3337297    15.28   0.000     4.443869    5.752066
                 _Io_country_37 |   3.180557   .3353782     9.48   0.000     2.523228    3.837887
                 _Io_country_38 |   4.741135   .3059514    15.50   0.000     4.141481    5.340789
                 _Io_country_39 |   1.495386   .3113511     4.80   0.000     .8851496    2.105623
                 _Io_country_40 |   1.509291     .32632     4.63   0.000     .8697156    2.148867
                 _Io_country_41 |   5.150211   .2949507    17.46   0.000     4.572118    5.728303
                 _Io_country_42 |   6.215447   .3061713    20.30   0.000     5.615362    6.815532
                 _Io_country_43 |   8.494306    .310636    27.34   0.000     7.885471    9.103142
                 _Io_country_44 |  -.1430325   .4261938    -0.34   0.737    -.9783569     .692292
                 _Io_country_45 |   9.883642   .2631182    37.56   0.000     9.367939    10.39934
                 _Io_country_46 |  -.0807251   .4360649    -0.19   0.853    -.9353967    .7739464
                 _Io_country_47 |   .5850801   .4013168     1.46   0.145    -.2014863    1.371646
                 _Io_country_48 |  -.2195897   .4246516    -0.52   0.605    -1.051892    .6127122
                 _Io_country_49 |   5.915556    .435658    13.58   0.000     5.061682     6.76943
                 _Io_country_50 |   .4539481    .444065     1.02   0.307    -.4164033    1.324299
                 _Io_country_51 |   1.712448   .5273462     3.25   0.001     .6788683    2.746028
                 _Io_country_52 |    1.04545   .2863109     3.65   0.000     .4842913    1.606609
                 _Io_country_53 |   3.929057   .3001018    13.09   0.000     3.340869    4.517246
                 _Io_country_54 |   1.755124   .3897666     4.50   0.000     .9911955    2.519053
                 _Io_country_55 |   4.642693   .2963839    15.66   0.000     4.061791    5.223595
                 _Io_country_56 |   2.339257   .3838999     6.09   0.000     1.586827    3.091687
                 _Io_country_57 |   1.240186   .3085399     4.02   0.000     .6354584    1.844913
                 _Io_country_58 |   3.538404   .3296869    10.73   0.000     2.892229    4.184578
                 _Io_country_59 |   .2464082   .3899152     0.63   0.527    -.5178115    1.010628
                 _Io_country_60 |   3.269398   .2879417    11.35   0.000     2.705043    3.833754
                 _Io_country_61 |  -1.799663   .4815534    -3.74   0.000     -2.74349   -.8558354
                 _Io_country_62 |   1.048054   .2863119     3.66   0.000     .4868933    1.609215
                 _Io_country_63 |   8.062706   .2749048    29.33   0.000     7.523902    8.601509
                 _Io_country_64 |   5.024368   .2996043    16.77   0.000     4.437155    5.611582
                 _Io_country_65 |  -.2536804    .395666    -0.64   0.521    -1.029171    .5218106
                 _Io_country_66 |   6.069716   .2978604    20.38   0.000     5.485921    6.653512
                 _Io_country_67 |   .1440842   .4680351     0.31   0.758    -.7732478    1.061416
                 _Io_country_68 |   .2109399   .3308315     0.64   0.524    -.4374779    .8593577
                 _Io_country_69 |   .2318769   .3585559     0.65   0.518    -.4708797    .9346334
                 _Io_country_70 |   1.568518   .3384619     4.63   0.000     .9051452    2.231891
                 _Io_country_71 |   4.178507   .3077147    13.58   0.000     3.575397    4.781616
                 _Io_country_72 |   3.481913   .2690881    12.94   0.000      2.95451    4.009316
                 _Io_country_73 |   .3789064   .3613142     1.05   0.294    -.3292563    1.087069
                 _Io_country_74 |   2.179181   .2840631     7.67   0.000     1.622428    2.735935
                 _Io_country_75 |   5.450685   .2944945    18.51   0.000     4.873486    6.027883
                 _Io_country_76 |   2.205877   .3379857     6.53   0.000     1.543437    2.868317
                 _Io_country_77 |    4.44928   .3099468    14.35   0.000     3.841796    5.056765
                 _Io_country_78 |   2.763328   .2502395    11.04   0.000     2.272868    3.253788
                 _Io_country_79 |   3.671347   .4292145     8.55   0.000     2.830102    4.512592
                 _Io_country_80 |   5.060437    .339139    14.92   0.000     4.395737    5.725137
                 _Io_country_81 |   6.822557   .2893951    23.58   0.000     6.255353    7.389761
                 _Io_country_82 |   .5192109   .3162869     1.64   0.101    -.1007001    1.139122
                 _Io_country_83 |   8.263921    .308368    26.80   0.000     7.659531    8.868311
                 _Io_country_84 |    8.24959   .3480859    23.70   0.000     7.567354    8.931826
                 _Io_country_85 |   2.496365   .3206864     7.78   0.000     1.867831    3.124899
                 _Io_country_86 |  -.0804472    .422946    -0.19   0.849    -.9094061    .7485117
                 _Io_country_87 |   1.105817   .3436936     3.22   0.001     .4321899    1.779444
                 _Io_country_88 |    3.20714   .3567206     8.99   0.000      2.50798    3.906299
                 _Io_country_89 |   2.711653   .3619893     7.49   0.000     2.002167    3.421139
                 _Io_country_90 |   1.396323   .3075033     4.54   0.000     .7936277    1.999019
                 _Io_country_91 |   9.259329   .3009099    30.77   0.000     8.669556    9.849102
                 _Io_country_92 |   10.90914    .305229    35.74   0.000      10.3109    11.50738
                 _Io_country_93 |   1.696042   .3752012     4.52   0.000     .9606615    2.431423
                 _Io_country_94 |   .3005881   .4208345     0.71   0.475    -.5242324    1.125409
                 _Io_country_95 |   2.156715   .3426491     6.29   0.000     1.485135    2.828295
                 _Io_country_96 |   1.179125   .4956383     2.38   0.017     .2076921    2.150559
                          _cons |  -1.777824   .3320964    -5.35   0.000    -2.428721   -1.126927
-------------------------------------------------------------------------------------------------
Note: One or more parameters could not be estimated in 42 bootstrap replicates;
      standard-error estimates include only complete replications.