{smcl}
{com}{sf}{ul off}{txt}
{com}. 
. **** REPLICATION OF FIGURE B1 ****
. 
. clear all
{res}{txt}
{com}. set mem 2g
{txt}{bf:set memory} ignored.
{p 4 4 2}
Memory no longer
needs to be set in modern Statas;
memory adjustments are performed on the fly
automatically.
{p_end}

{com}. set more off
{txt}
{com}. 
. /*      
>         OUTLINE
>         1. MERGE DATA
>         2. GRAPH
> */
. 
. *************************
. ***** 1. MERGE DATA *****
. *************************
. 
. use $data\EEREV-D-21-00004_Data_Municipalities.dta, clear
{txt}
{com}. 
. drop if annee!=1969
{txt}(11,053 observations deleted)

{com}. drop if dep!=57 & dep!=67 & dep!=68
{txt}(0 observations deleted)

{com}. 
. merge m:1 ct_1936_str ar_1936_str using $data\EEREV-D-21-00004_Data_Canton1936.dta
{res}{txt}(label {bf:{txt}ar_1936_enc} already defined)

{col 5}Result{col 33}Number of obs
{col 5}{hline 41}
{col 5}Not matched{col 30}{res}               0
{txt}{col 5}Matched{col 30}{res}           1,579{txt}  (_merge==3)
{col 5}{hline 41}

{com}. drop _merge
{txt}
{com}. 
. ********************
. ***** 2. GRAPH *****
. ********************
. 
. // Scatter - Insee 1956
. 
. preserve
{txt}
{com}. 
. collapse (mean) displaced_war_1946 perc_i_full [w=pop_1936], by(ct_1936_enc dep)
{txt}(analytic weights assumed)
{res}{txt}
{com}. 
. sum displaced_war_1946 perc_i_full, d

                  {txt}(mean) displaced_war_1946
{hline 61}
      Percentiles      Smallest
 1%    {res} .4354649       .4354649
{txt} 5%    {res} .9953485       .4665696
{txt}10%    {res} 1.399709       .6220928       {txt}Obs         {res}         93
{txt}25%    {res} 2.706104        .777616       {txt}Sum of wgt. {res}         93

{txt}50%    {res} 3.984055                      {txt}Mean          {res}  3.74727
                        {txt}Largest       Std. dev.     {res} 1.593851
{txt}75%    {res} 4.767245       6.742247
{txt}90%    {res} 5.453992        6.81035       {txt}Variance      {res}  2.54036
{txt}95%    {res} 6.367678       7.729748       {txt}Skewness      {res}-.0146652
{txt}99%    {res} 7.999188       7.999188       {txt}Kurtosis      {res} 2.927799

                     {txt}(mean) perc_i_full
{hline 61}
      Percentiles      Smallest
 1%    {res} .3664182       .3664182
{txt} 5%    {res} 1.497339       .8314489
{txt}10%    {res} 2.939373       .9525363       {txt}Obs         {res}         93
{txt}25%    {res} 5.731712       1.473282       {txt}Sum of wgt. {res}         93

{txt}50%    {res} 7.545111                      {txt}Mean          {res} 7.034319
                        {txt}Largest       Std. dev.     {res} 2.687588
{txt}75%    {res} 9.064373       10.58393
{txt}90%    {res} 10.15568       10.81344       {txt}Variance      {res} 7.223131
{txt}95%    {res} 10.56515       11.47431       {txt}Skewness      {res}-.6662567
{txt}99%    {res} 11.69026       11.69026       {txt}Kurtosis      {res} 2.735868
{txt}
{com}. pwcorr displaced_war_1946 perc_i_full, sig o

             {txt}{c |} dis~1946 perc_i~l
{hline 13}{c +}{hline 18}
displac~1946 {c |} {res}  1.0000 
             {txt}{c |}
             {c |}{res}       93
             {txt}{c |}
 perc_i_full {c |} {res}  0.7904   1.0000 
             {txt}{c |}{res}   0.0000
             {txt}{c |}{res}       93       93
             {txt}{c |}

{com}. 
. twoway ///
>         (scatter perc_i_full displaced_war_1946) ///    
>         (lfit perc_i_full displaced_war_1946, lp(dash) lcolor(maroon) range(0 8)), ///  (% of 1936 pop)
>         ytitle("Wehrmacht conscription: Index data", margin(vsmall)) ylabel(0(6)12, angle(0) format(%5.0f)) xlabel(0(4)8, format(%5.0f)) yscale(r(-1.2 13.2)) xscale(r(-.8 8.8)) /// 
>         xtitle("Wehrmacht conscription: INSEE (1956) data", margin(small)) /// (% of 1946 pop)
>         legend(off) title("INSEE (1956) (Sub-district level)", ring(0)) graphregion(color(white)) name(insee, replace) //       
{res}{txt}
{com}. 
. restore
{txt}
{com}. 
. // Scatter - Casualties
. 
. sum perc_casualties perc_i_full if perc_casualties!=., d

                  {txt}Wehrmacht casulaties (\%)
{hline 61}
      Percentiles      Smallest
 1%    {res}        0              0
{txt} 5%    {res} .8498583              0
{txt}10%    {res}  1.19149              0       {txt}Obs         {res}        870
{txt}25%    {res} 1.702128              0       {txt}Sum of wgt. {res}        870

{txt}50%    {res}  2.33183                      {txt}Mean          {res} 2.372048
                        {txt}Largest       Std. dev.     {res} 1.000995
{txt}75%    {res} 2.962963       5.882353
{txt}90%    {res} 3.622179       5.882353       {txt}Variance      {res}  1.00199
{txt}95%    {res} 4.112554       7.103825       {txt}Skewness      {res} .5850133
{txt}99%    {res}     5.25       7.492795       {txt}Kurtosis      {res} 4.474664

                   {txt}Conscription proxy (\%)
{hline 61}
      Percentiles      Smallest
 1%    {res} .9660645              0
{txt} 5%    {res} 3.901414              0
{txt}10%    {res} 5.183428              0       {txt}Obs         {res}        870
{txt}25%    {res} 6.916143              0       {txt}Sum of wgt. {res}        870

{txt}50%    {res}  8.87419                      {txt}Mean          {res} 9.320237
                        {txt}Largest       Std. dev.     {res}  3.90971
{txt}75%    {res} 11.29626       27.81331
{txt}90%    {res} 14.14498       31.40817       {txt}Variance      {res} 15.28584
{txt}95%    {res} 16.01633       36.71045       {txt}Skewness      {res} 1.456787
{txt}99%    {res} 19.42406        39.3405       {txt}Kurtosis      {res} 10.81071
{txt}
{com}. pwcorr perc_casualties perc_i_full, sig o

             {txt}{c |} perc_c~s perc_i~l
{hline 13}{c +}{hline 18}
perc_casua~s {c |} {res}  1.0000 
             {txt}{c |}
             {c |}{res}      870
             {txt}{c |}
 perc_i_full {c |} {res}  0.5808   1.0000 
             {txt}{c |}{res}   0.0000
             {txt}{c |}{res}      870     1579
             {txt}{c |}

{com}. 
. twoway ///
>         (scatter perc_i_full perc_casualties) ///       
>         (lfit perc_i_full perc_casualties, lp(dash) lcolor(maroon) range(0 8)), ///  (% of 1936 pop)
>         ytitle("Wehrmacht conscription: Index data", margin(vsmall)) ylabel(0(20)40, angle(0) format(%5.0f)) xlabel(0(4)8, format(%5.0f)) yscale(r(-4 44)) xscale(r(-.8 8.8)) /// 
>         xtitle("Wehrmacht casualties", margin(small)) /// (% of 1946 pop)
>         legend(off) title("Casualties (Municipality level)", ring(0)) graphregion(color(white)) name(casualties, replace) //
{res}{txt}
{com}. 
. // Combine graphs
.         
. graph combine insee casualties ///
>         , c(2) graphregion(color(white)) imargin(vsmall) //ycommon
{res}{txt}
{com}. graph export "$results\\$program.png", replace width(7200) height(3000)
{txt}{p 0 4 2}
file {bf}
D:\Dropbox\SVLACHOS\Research\Malgre_nous\Replication_files\Results\EEREV-D-21-00004_FigureB1.png{rm}
saved as
PNG
format
{p_end}

{com}. 
. cap log close
{smcl}
{com}{sf}{ul off}