Hi, I got this code to apply to my dataset and to substitute with my variables. there is a macro, that I do not know how to use. I would be very thankful if you could tell me where to substitute my variables (I neither have the dateset where this code worked, so i cannot compare to understand). %macro AUC_test (input= , pd_est= , default_flag= , Segmento= );
data campione_&segmento.;
set &input.;
*where MOD_RATING_ALLA_DATA_RIF= "&segmento.";
run;
/* AUC calculation */
proc freq data = campione_&segmento. noprint;
table &pd_est. * &default_flag. / missing measures;
output out=_smd measures;
run;
data _smd_&pd_est._&segmento.;
set _smd (keep = _smdrc_ e_smdrc n);
format AUC 17.15;
format Esito $6.;
AUC = (_smdrc_ + 1)/2;
if AUC<= 0.65 then Esito= "ROSSO";
else if 0.65<AUC<= 0.8 then Esito= "GIALLO";
else if AUC>0.8 then Esito= "VERDE";
Segmento="&segmento.";
run;
%mend;
/*BASE*/
%AUC_test (input = Discr , pd_est = PD0Base , default_flag = flag_default_finale, Segmento= IMP );
%AUC_test (input = Discr , pd_est = PD0Base , default_flag = flag_default_finale, Segmento= POE );
%AUC_test (input = Discr , pd_est = PD0Base , default_flag = flag_default_finale, Segmento= PRI );
%AUC_test (input = Discr , pd_est = PD0Base , default_flag = flag_default_finale, Segmento= SMB );
/*WEIGHTED*/
%AUC_test (input = Discr , pd_est = PD_weighted , default_flag = flag_default_finale, Segmento= IMP );
%AUC_test (input = Discr , pd_est = PD_weighted , default_flag = flag_default_finale, Segmento= POE );
%AUC_test (input = Discr , pd_est = PD_weighted , default_flag = flag_default_finale, Segmento= PRI );
%AUC_test (input = Discr , pd_est = PD_weighted , default_flag = flag_default_finale, Segmento= SMB );
data AUC_Base;
set _smd_pd0base_imp _smd_pd0base_poe _smd_pd0base_pri _smd_pd0base_smb;
run;
data AUC_Weighted;
set _smd_pd_weighted_imp _smd_pd_weighted_poe _smd_pd_weighted_pri _smd_pd_weighted_smb;
run;
... View more