由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - R 里面有没有实现多个if statement 的简单办法?多谢。
相关主题
请教一sas codeSAS BASE/ADV study group
请问 Proc Anova 里的 scheffe options 怎么解释求问一个SAS编程的问题
SAS快捷键问题求教一道SAS题
SAS问题请教包子太少,不如发个面经答谢一下算了
SQL中啥时候用group by, 啥时候用self-join?请教一个sample size calculation的问题
MySQL语句请教 (转载)求救, 一个SAS 数据处理问题
求教,有关feature selection的我也来请教一个SAS问题
A SAS question参加地域性的SAS USER'S GROUP MEETING (转载)
相关话题的讨论汇总
话题: sas话题: like话题: x9话题: code
进入Statistics版参与讨论
1 (共1页)
w*******n
发帖数: 469
1
My point is not to write a code like the following, which looks so complicated, but like the code in SAS,"select ...case 1....when....then... "
if a=1 then
b=x1
c=x2,
d=x3.
if a=2 then
b=x4,
c=x5,
d=x6.
if a=3 then
b=x7,
c=x8,
d=x9.
D******n
发帖数: 2836
2
why not? not sure what u mean though.
t**i
发帖数: 688
3
switch

complicated, but like the code in SAS,"select ...case 1....when....then...
"

【在 w*******n 的大作中提到】
: My point is not to write a code like the following, which looks so complicated, but like the code in SAS,"select ...case 1....when....then... "
: if a=1 then
: b=x1
: c=x2,
: d=x3.
: if a=2 then
: b=x4,
: c=x5,
: d=x6.
: if a=3 then

l*******D
发帖数: 282
4
Try ifelse
G**Y
发帖数: 33224
5
x = c(x1, ..., x9);
groups = c(1, 1, 1, 2, 2, 2, 3, 3, 3);
idx = (groups %in% a);
y = x[idx];
b = y[1];
c = y[2];
d = y[3];

complicated, but like the code in SAS,"select ...case 1....when....then... "

【在 w*******n 的大作中提到】
: My point is not to write a code like the following, which looks so complicated, but like the code in SAS,"select ...case 1....when....then... "
: if a=1 then
: b=x1
: c=x2,
: d=x3.
: if a=2 then
: b=x4,
: c=x5,
: d=x6.
: if a=3 then

1 (共1页)
进入Statistics版参与讨论
相关主题
参加地域性的SAS USER'S GROUP MEETING (转载)SQL中啥时候用group by, 啥时候用self-join?
请问sas base 123 no. 33MySQL语句请教 (转载)
SAS Proc Mixed Estimate for 3 way interaction求教,有关feature selection的
How to prepare the SAS certificates without wasting time?A SAS question
请教一sas codeSAS BASE/ADV study group
请问 Proc Anova 里的 scheffe options 怎么解释求问一个SAS编程的问题
SAS快捷键问题求教一道SAS题
SAS问题请教包子太少,不如发个面经答谢一下算了
相关话题的讨论汇总
话题: sas话题: like话题: x9话题: code