Что делает этот код в SAS (макрос)? Нужно написать аналог в R
Получила задание написать код в R, который будет выдавать такой же результат, как код в SAS. Но я в SAS никогда не работала, тем более с макросами. Подскажите, пожалуйста поэтапно, что этот код делает? Чтобы я могла написать аналог в R
data gini;
run;
%do i=1 %to %sysfunc(countw(&vars));
%let varr=%scan(&vars,&i);
*no print only print the statistics and not the frequency table between
def and the variable;
proc freq data = &file noprint;
table &varr. * &target. / noprint MEASURES;
*keeps sommers d (rc) value and ase
sommers d => used to determine the strength and direction of relation between pairs of variables
[-1,1] => [disagree,agree] (concordant.pairs-discordant.pairs)/total.pairs;
*and sommers d (rc) ase => asymptotic standard error;
output out=gini_var&i (keep = N _SMDRC_) MEASURES;
run;
data gini;
set gini gini_var&i;
run;
proc delete data=gini_var&i;
run;
%end;
data gini;
set gini;
rename _SMDRC_=gini;
id=_n_;
run;
%mend gini;```