我正在使用SAS大学版.我需要根据现有的亚种族创建一个新的种族变量.有没有办法选择'WHITE all'而不是指定'WHITE-RUSSIAN'或'WHITE-EUROPEAN'并创建新变量.
这是我的代码.
data agg1;
set agg;
if ethnicity = 'WHITE' then ethnicity1= 'white' ;
if ethnicity = 'WHITE-RUSSIAN' then ethnicity1= 'white' ;
if ethnicity = 'WHITE-EUROPEAN' then ethnicity1= 'white';
.
.
run ;
Run Code Online (Sandbox Code Playgroud) sas ×1