由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - PROC REG中可以用IF语句么?
相关主题
统计新人问个自学SAS的问题问一个模型拟合问题
[SAS]programming statement in Proc GLMMIX/NLMIX/MODELSAS 问题求助
请教:sas 循环请教一个sas 问题
求大侠指点,GEE macro in SASSAS DATA 求助
pk/pd modelling by proc nlinmixed,help neededHow to Macro it in SAS?
求助SAS问题,如何筛选排名三分之一的数据菜鸟问题:如何在PROC NLIN结果中输出AIC?
如何在用SAS给多个data step 和proc step 做循环语句呢?求教proc nlin
如何把R2,P 值,系数等自动从PROC REG搞出来compute AIC in Proc Logisitic and Proc Phreg
相关话题的讨论汇总
话题: proc话题: reg话题: model话题: data话题: statement
进入Statistics版参与讨论
1 (共1页)
p*****o
发帖数: 543
1
比如:
PROC REG;
IF A=1 THEN MODEL C=B;
IF A=0 THEN MODEL C=B D;
RUN;
试了一下,好像不可以啊,那有没有办法可以解决这个问题么?
非常感谢
s**c
发帖数: 1247
2
用macro吧

【在 p*****o 的大作中提到】
: 比如:
: PROC REG;
: IF A=1 THEN MODEL C=B;
: IF A=0 THEN MODEL C=B D;
: RUN;
: 试了一下,好像不可以啊,那有没有办法可以解决这个问题么?
: 非常感谢

p*****o
发帖数: 543
3
忘记说了,我这个PROC REG其实是在一个大的MACRO中的。是不是应该在PROC外围用%DO
%WHILE来解决啊
a********l
发帖数: 40
4
why not use proc glm
class
A*******s
发帖数: 3942
5
这个A是variable么?
如果是的话,创建一个E,和A刚好相反,E=1 when A=0, E=0 when A=1
model C=B E*D

【在 p*****o 的大作中提到】
: 比如:
: PROC REG;
: IF A=1 THEN MODEL C=B;
: IF A=0 THEN MODEL C=B D;
: RUN;
: 试了一下,好像不可以啊,那有没有办法可以解决这个问题么?
: 非常感谢

D******n
发帖数: 2836
6
what is A? it doesnt look like a macro variable, then the question is what d
o u exactly want to do?

【在 p*****o 的大作中提到】
: 比如:
: PROC REG;
: IF A=1 THEN MODEL C=B;
: IF A=0 THEN MODEL C=B D;
: RUN;
: 试了一下,好像不可以啊,那有没有办法可以解决这个问题么?
: 非常感谢

p*****o
发帖数: 543
7
A is a macro variable....I just wanna put a indicator as A. Since we are not
sure whether we are going to use the first model or the second one. And I
wanna make it flexible in future by adding A as a macro variable.
So once I put A = 1 in future, it will use the 1st model and if I put A=0,
it will use the 2nd model...

d

【在 D******n 的大作中提到】
: what is A? it doesnt look like a macro variable, then the question is what d
: o u exactly want to do?

p*****o
发帖数: 543
8
btw, what i want to know is that whether it is possible to use if statement
in Proc Reg.
just by saying the problem itself, i think there are a lot of substitute
ways to do it.
s*r
发帖数: 2757
9
if might be used for data subsetting
s*******f
发帖数: 148
10
I think IF,THEN statement is only valid in DATA step.
It won't take effect in any PROC steps.
You may refer to SAS help document for confirmation.

statement

【在 p*****o 的大作中提到】
: btw, what i want to know is that whether it is possible to use if statement
: in Proc Reg.
: just by saying the problem itself, i think there are a lot of substitute
: ways to do it.

相关主题
求助SAS问题,如何筛选排名三分之一的数据问一个模型拟合问题
如何在用SAS给多个data step 和proc step 做循环语句呢?SAS 问题求助
如何把R2,P 值,系数等自动从PROC REG搞出来请教一个sas 问题
进入Statistics版参与讨论
s*r
发帖数: 2757
11
ok only where can be used

【在 s*r 的大作中提到】
: if might be used for data subsetting
o****o
发帖数: 8077
12
'if then' programming statements are valid in many PROCs, such as PHREG,
NLMIXED, NLIN, to name a few

【在 s*******f 的大作中提到】
: I think IF,THEN statement is only valid in DATA step.
: It won't take effect in any PROC steps.
: You may refer to SAS help document for confirmation.
:
: statement

s*******f
发帖数: 148
13
oh really? Then sorry to louzhu for the wrong information@@
coz in the help document of IF-THEN/ELSE statement, it says "Valid: in DATA
step", so I thought it was only valid in DATA. Maybe I got it wrong@@
Anyway, thanks a lot for pointing out:)

【在 o****o 的大作中提到】
: 'if then' programming statements are valid in many PROCs, such as PHREG,
: NLMIXED, NLIN, to name a few

o****o
发帖数: 8077
14
any PROC that supports user defined likelihood function or there is a page
of 'PROGRAMMING STATEMENT' in Detail section would support complex logic
programming

DATA

【在 s*******f 的大作中提到】
: oh really? Then sorry to louzhu for the wrong information@@
: coz in the help document of IF-THEN/ELSE statement, it says "Valid: in DATA
: step", so I thought it was only valid in DATA. Maybe I got it wrong@@
: Anyway, thanks a lot for pointing out:)

s*r
发帖数: 2757
p*****o
发帖数: 543
16
thank you guys for all the shared information
1 (共1页)
进入Statistics版参与讨论
相关主题
compute AIC in Proc Logisitic and Proc Phregpk/pd modelling by proc nlinmixed,help needed
How to output score test statistic from PROC PHREG?求助SAS问题,如何筛选排名三分之一的数据
proc lifetest和proc phreg有哪些区别如何在用SAS给多个data step 和proc step 做循环语句呢?
请问一下,proc phreg如何把R2,P 值,系数等自动从PROC REG搞出来
统计新人问个自学SAS的问题问一个模型拟合问题
[SAS]programming statement in Proc GLMMIX/NLMIX/MODELSAS 问题求助
请教:sas 循环请教一个sas 问题
求大侠指点,GEE macro in SASSAS DATA 求助
相关话题的讨论汇总
话题: proc话题: reg话题: model话题: data话题: statement