The directory contains the following files:
  - Peru_borders.bnd:               BND-file of the map of Peru
  - Code_..._Paper.R:               Code to run the model selection specified in ... some plots are generated at the end
  - CreateData_Peru2012.R:          Code to restructe the DHS data to the data set used in this paper
  - plot.expectreg.accepted:        Slightly modified plot function for the paper.
  - plot_Scoring_Paper_accepted.R:  Code to build the plots printed in the paper
  - print_xtables.R:                Code to print the tables of the selected models in the paper and the supplementary material. To build the boxes some recoding has to be done by hand
  - renameTables.R:                 Functions to recode the tables and labs
  - expectreg_0.50.tar.gz:          R-source package containing the first version of the expectreg package that can split P-splines
  - expectregSelection_0.10.tar.gz: R-source package that contains the functions to select the models
  - ExtraFunctions_0.1.tar.gz:      R-source package to build the legends as extra plots.



The following structure is useful to rebuild the analysis:
    0) Install the packages expectreg(>= 0.50), expectregSelection, ExtraFunctions (just for plotting the legends separately)
    1) Load data from DHS ("http://www.dhsprogram.com/data/dataset/Peru_Continuous-DHS_2012.cfm")
    2) Unzip the data (pekr6idt.zip containing PEKR6IFL.dta)
    3) Apply CreateData_Peru2012.R to generate our complete case data set peru12_de_new.csv
    4) Run Code_....R to apply the model selection. 
       Take care some of them need days for running!
    5) Run print_xtables.R to generate the tables of the paper
    6) Run plot_Scoring_Paper_accepted.R to generate the figures of the paper






