{smcl}
{com}{sf}{ul off}{txt}
{com}. 
. **** REPLICATION OF TABLE B5 ****
. 
. 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. DESCRIPTIVES TABLE
> */
. 
. *********************************
. ***** 1. DESCRIPTIVES TABLE *****
. *********************************
. 
. // Import candidate data
. 
. use $data\EEREV-D-21-00004_Data_Candidates.dta, clear
{txt}
{com}. 
. // Prepare variables
. 
. g Candidate=candidate
{txt}
{com}. 
. replace Candidate="Chaban-Delmas"               if candidate=="ChabanDelmas"
{txt}(1 real change made)

{com}. replace Candidate="de Gaulle"                   if candidate=="DeGaulle"
{txt}(1 real change made)

{com}. replace Candidate="de Villiers"                 if candidate=="DeVilliers"
{txt}(2 real changes made)

{com}. replace Candidate="Dupont-Aignan"               if candidate=="DupontAignan"
{txt}(2 real changes made)

{com}. replace Candidate="Giscard d'Estaing"   if candidate=="GiscarddEstaing"
{txt}variable {bf}{res}Candidate{sf}{txt} was {bf}{res}str16{sf}{txt} now {bf}{res}str17{sf}
{txt}(1 real change made)

{com}. replace Candidate="Le Pen JM"                   if candidate=="LePen"                           & annee<=2007
{txt}(4 real changes made)

{com}. replace Candidate="Le Pen M"                    if candidate=="LePen"                           & annee>2007
{txt}(2 real changes made)

{com}. replace Candidate="Saint-Josse"                 if candidate=="SaintJosse"
{txt}(1 real change made)

{com}. replace Candidate="Tixier-Vignancour"   if candidate=="TixierVignancour"
{txt}(1 real change made)

{com}. replace Candidate="H\'eraud"                    if candidate=="Heraud"
{txt}(1 real change made)

{com}. replace Candidate="Chev\\`enement"              if candidate=="Chevenement"
{txt}(1 real change made)

{com}. replace Candidate="Mam\\`ere"                   if candidate=="Mamere"
{txt}(1 real change made)

{com}. replace Candidate="M\'egret"                    if candidate=="Megret"
{txt}(1 real change made)

{com}. replace Candidate="Bov\'e"                              if candidate=="Bove"
{txt}(1 real change made)

{com}. replace Candidate="M\'elenchon"                 if candidate=="Melenchon"
{txt}(2 real changes made)

{com}. 
. tostring annee, g(Election)
{txt}Election generated as {res:str4}

{com}. rename data Data
{res}{txt}
{com}. 
. foreach var in poll neg_C nat_C aut_C rle_C{c -(}
{txt}  2{com}.         replace `var'=0 if `var'<0.0001 & `var'>-0.0001
{txt}  3{com}. {c )-}
{txt}(0 real changes made)
(0 real changes made)
(5 real changes made)
(15 real changes made)
(0 real changes made)

{com}. 
. g Polls=strofreal(poll)
{txt}
{com}. g Radical=strofreal(neg_C)
{txt}
{com}. g Nation=strofreal(nat_C)
{txt}
{com}. g Authority=strofreal(aut_C)
{txt}
{com}. g LRindex=strofreal(rle_C)
{txt}
{com}. 
. drop poll neg_C nat_C aut_C rle_C
{txt}
{com}. 
. replace Candidate=Candidate+" ("+Election+")"
{txt}variable {bf}{res}Candidate{sf}{txt} was {bf}{res}str17{sf}{txt} now {bf}{res}str24{sf}
{txt}(83 real changes made)

{com}. drop Election
{txt}
{com}. 
. keep Candidate Data Polls Radical Nation Authority LRindex
{txt}
{com}. order Candidate Data Polls Radical Nation Authority LRindex
{txt}
{com}. sort Candidate
{txt}
{com}. 
. cd "$results"
{res}D:\Dropbox\SVLACHOS\Research\Malgre_nous\Replication_files\Results
{txt}
{com}. *dataout, head tex replace save($program) dec(3) // Results exported manually
. 
. cap log close
{smcl}
{com}{sf}{ul off}