由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS Macro question about %scan(&covariates,&h)
相关主题
问大家一个Macro的问题请帮忙看3道SAS题。
a question regarding sas programming一道ADV 130 题目
请教两个SAS的问题SAS ADVANCED 一道题求助
A quick question about masking in macroSAS call symput question
SAS macro的一个小问题请教SAS adv 题库一道macro题
【包子】求问个简单sas macro问题请教一个sas macro的问题
SAS macro variable resolution question包子问一个统计基本概念
请教做过Multiple Imputation 的牛牛们问个概念。
相关话题的讨论汇总
话题: covariates话题: sas话题: macro话题: obs话题: warning
进入Statistics版参与讨论
1 (共1页)
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;

1 (共1页)
进入Statistics版参与讨论
相关主题
问个概念。SAS macro的一个小问题
急问一个analysis of covariance的问题【包子】求问个简单sas macro问题
question on time-dependent baseline in SAS phreg!SAS macro variable resolution question
求教 顾客各种属性\所定杂志 PATTERN 的分析请教做过Multiple Imputation 的牛牛们
问大家一个Macro的问题请帮忙看3道SAS题。
a question regarding sas programming一道ADV 130 题目
请教两个SAS的问题SAS ADVANCED 一道题求助
A quick question about masking in macroSAS call symput question
相关话题的讨论汇总
话题: covariates话题: sas话题: macro话题: obs话题: warning