{smcl}
{com}{sf}{ul off}{txt}
{com}. 
. **** REPLICATION OF FIGURE C1 ****
. 
. 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. GRAPH
> */
. 
. ********************
. ***** 1. GRAPH *****
. ********************
. 
. // Import data
. 
. use $data\EEREV-D-21-00004_Data_Municipalities.dta, clear
{txt}
{com}. 
. // Generate periods
. 
. gen post=1*(annee>=1988)
{txt}
{com}. 
. // Collapse by period
. 
. collapse (mean) perc_voixexd_ins perc_bna_ins, by(com alsace post perc_i_full)
{res}{txt}
{com}. 
. // Reshape
. 
. reshape wide perc_voixexd_ins perc_bna_ins, i(com alsace) j(post)
{txt}(j = 0 1)

Data{col 36}Long{col 43}->{col 48}Wide
{hline 77}
Number of observations     {res}       3,158   {txt}->   {res}1,579       
{txt}Number of variables        {res}           6   {txt}->   {res}7           
{txt}j variable (2 values)              {res}post   {txt}->   (dropped)
xij variables:
                       {res}perc_voixexd_ins   {txt}->   {res}perc_voixexd_ins0 perc_voixexd_ins1
                           perc_bna_ins   {txt}->   {res}perc_bna_ins0 perc_bna_ins1
{txt}{hline 77}

{com}. 
. // Collapse by percentile
. 
. foreach case in perc_i_full{c -(}
{txt}  2{com}.         xtile I_`case'=`case', n(50)
{txt}  3{com}.         replace I_`case'=2*I_`case'
{txt}  4{com}. {c )-}
{txt}(1,579 real changes made)

{com}. 
. collapse (mean) perc_voixexd_ins* perc_bna_ins*, by(I_perc_i_full)
{res}{txt}
{com}. 
. // Vote
. 
. cap g perc_voixexd_ins0_g=perc_voixexd_ins0+15 // To rescale y-axis
{txt}
{com}. 
. twoway ///
>         (scatter perc_voixexd_ins0_g I_perc_i_full, mcolor(navy*.3) msymbol(D)) ///     
>         (lfit perc_voixexd_ins0_g I_perc_i_full, lp(dash) lcolor(gs14)) ///
>         (scatter perc_voixexd_ins1 I_perc_i_full, mcolor(navy)) ///     
>         (lfit perc_voixexd_ins1 I_perc_i_full, lp(dash) lcolor(maroon)), ///
>         title("Radical right-wing 1995-2017", ring(0)) ///
>         ytitle("Percent of registered voters", margin(vsmall)) ///              
>         ylabel(15 "0" 16 "1" 17 20(4)24, angle(0) format(%5.0f)) yscale(r(15 25)) ///
>         xtitle("Conscription percentile", margin(medium)) ///
>         legend(off) graphregion(color(white)) name(vote, replace) //
{res}{txt}
{com}. 
. // Abstention
. 
. twoway ///
>         (scatter perc_bna_ins1 I_perc_i_full, mcolor(navy*.3) msymbol(D)) ///   
>         (scatter perc_bna_ins0 I_perc_i_full, mcolor(navy)) ///         
>         (lfit perc_bna_ins1 I_perc_i_full, lp(dash) lcolor(gs14)) ///
>         (lfit perc_bna_ins0 I_perc_i_full, lp(dash) lcolor(maroon)), ///
>         title("Abstention 1965-1974", ring(0)) ///
>         ytitle("Percent of registered voters", margin(vsmall)) ///      
>         ylabel(13(4)21, angle(0) format(%5.0f)) yscale(r(12 22)) ///
>         xtitle("Conscription percentile", margin(medium)) ///
>         legend(off) graphregion(color(white)) name(abst, replace) //
{res}{txt}
{com}. 
. // Combine graphs
. 
. graph combine abst vote ///
>         , c(2) graphregion(color(white)) imargin(vsmall)
{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_FigureC1.png{rm}
saved as
PNG
format
{p_end}

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