小编Kul*_*Kul的帖子

在SAS中使用If-then语句,多个变量

我正在使用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
推荐指数
1
解决办法
239
查看次数

标签 统计

sas ×1