Annex: code to replicate the results and the figures in the report

AuthorFrancesca Torti - Marco Riani - Anthony C. Atkinson - Domenico Perrotta - Aldo Corbellini
ProfessionEuropean Commission, Joint Research Centre (JRC) - University of Parma, Italy - London School of Economics, UK - European Commission, Joint Research Centre (JRC) - University of Parma, Italy
Pages30-30
A. Annex: code to replicate the results and the figures in the
report
/**************set path where input dataset are stored ******************/
path = "D:\benchmark_FSDA\software_and_ds_to_upload\ds\ds_for_exploratory_analysis";
/*load loyalty data on original scale*/
libname lib (path);
use ("lib.loyalty");
read all var {’x1’ ’x2’ ’x3’} into x[colname=colnx];
read all var ’y’ into y[colname=colny];
x = x || j(nrow(x),1,1); /* add intercept */
close ("lib.loyalty");
/*next command + F11 to obtain Figures 2, 3, 4, that is mdr fwd plot, res fwd plot, scatteplots,
beta fwd plots for 0.4 transformation*/
CALL FSR("lib.loyalty", {’x1’ ’x2’ ’x3’}, "y", "DEBUG CLASSIFY RESFWDPLOT mdrplot scatter BETA_PLOT") transform_original_data = 0.4 ;
/*next command + F11 to obtain Figures 8, 9, 10, that is mdr fwd plot, res fwd plot, scatteplots,
beta fwd plots for no transformation*/
CALL FSR("lib.loyalty", {’x1’ ’x2’ ’x3’}, "y", "DEBUG CLASSIFY RESFWDPLOT mdrplot scatter BETA_PLOT") transform_original_data = 1 ;
/*next command to obtain Figure 11, that is the fanplot*/
CALL FSRfan("lib.loyalty", {’x1’ ’x2’ ’x3’}, ’y’, {-1 -0.5 -0.4 0 0.4 0.5 1});
/*next command + F11 to obtain Figures 12, 13, 14, that is mdr fwd plot, res fwd plot, scatteplots,
beta fwd plots for logarithmic transformation*/
CALL FSR("lib.loyalty", {’x1’ ’x2’ ’x3’}, "y", "DEBUG CLASSIFY RESFWDPLOT mdrplot scatter BETA_PLOT") transform_original_data = 0 ;
/*next commands to obtain Figure 16 on books dataset (CN 49019900), the monitoring of studentized residual fro S, LTS and LMS estimators*/
use("lib.p_49019900_thinned");
read all var {’x’} into x[colname=colnx];
read all var {’y’} into y[colname=colny];
close("lib.p_49019900_thinned");
/*S*/
CALL monitoring_S_MM_LTS_LMS("lib.p_49019900_thinned","x","y","s") ;
/*MM not in the paper*/
CALL monitoring_S_MM_LTS_LMS("lib.p_49019900_thinned","x","y","mm") ;
/*LTS*/
CALL monitoring_S_MM_LTS_LMS("lib.p_49019900_thinned","x","y","lts") ;
/*LMS*/
CALL monitoring_S_MM_LTS_LMS("lib.p_49019900_thinned","x","y","lms") ;
/*next commands to obtain Figure on jewellery dataset (CN 7117190090), the monitoring of studentized residual fro S, LTS and LMS estimators*/
*use("lib.POD41_7117190090");
*read all var {’x’} into x[colname=colnx];
*read all var {’y’} into y[colname=colny];
*close("lib.POD41_7117190090");
/*S*/
*CALL monitoring_S_MM_LTS_LMS("lib.POD41_7117190090","x","y","s",path) ;
/*MM not in the paper*/
*CALL monitoring_S_MM_LTS_LMS("lib.POD41_7117190090","x","y","mm",path) ;
/*LTS*/
*CALL monitoring_S_MM_LTS_LMS("lib.POD41_7117190090","x","y","lts",path) ;
/*LMS*/
*CALL monitoring_S_MM_LTS_LMS("lib.POD41_7117190090","x","y","lms",path) ;
30

To continue reading

Request your trial

VLEX uses login cookies to provide you with a better browsing experience. If you click on 'Accept' or continue browsing this site we consider that you accept our cookie policy. ACCEPT