m*i 发帖数: 8 | 1 My following sas script has problems but I don't how to solve it.
Thanks in advance if anyone could help or provide some ideas.
%let covariates=age gender center EV1;
/*deleting records with missing covariates---complete obs only*/
data temp1;
set temp0;
do h=1 to %numwords(&covariates)-1;
%let name=%scan(&covariates,&h);
if &name=. then delete;
end;
The sas log showsthe following information:
WARNING: Apparent symbolic reference H not resolved.
WARNING: Apparent symbolic reference H not |
d*******1 发帖数: 854 | 2 你这个datastep 和macro的loop 全搞混了.macro运用的最高境界就是"不用".
改如下:
%let covariates=age gender center EV1;
/*deleting records with missing covariates---complete obs only*/
data temp1;
set temp0;
if n (of &covariates)<4 then delete;
run;
【在 m*i 的大作中提到】 : My following sas script has problems but I don't how to solve it. : Thanks in advance if anyone could help or provide some ideas. : %let covariates=age gender center EV1; : /*deleting records with missing covariates---complete obs only*/ : data temp1; : set temp0; : do h=1 to %numwords(&covariates)-1; : %let name=%scan(&covariates,&h); : if &name=. then delete; : end;
|
m*i 发帖数: 8 | 3 I don't want to delete any obs with n(of &covariate)<4. My goal is to delete
the obs with any one of the 4 covariates is missing. I keep only complete
obs(without any missing for all 4 covariates).
Thank you very much.
【在 m*i 的大作中提到】 : My following sas script has problems but I don't how to solve it. : Thanks in advance if anyone could help or provide some ideas. : %let covariates=age gender center EV1; : /*deleting records with missing covariates---complete obs only*/ : data temp1; : set temp0; : do h=1 to %numwords(&covariates)-1; : %let name=%scan(&covariates,&h); : if &name=. then delete; : end;
|