由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 求教proc sql 问题
相关主题
排序的问题,请问高手用SAS怎么做?SAS format 的问题
请教一个用SAS作DATA MERGE的问题请教SAS达人关于编循环regression的问题,多谢!
[提问]怎样提取SAS Dateset的observation number?请教一个SAS SQL的问题
SAS how to change variables' name要面试了,请问实际工作中large data set都是存在那里的?
SAS problem ask for help!请教一道SAS题
ask for help (urgent): A SAS questionSAS 问题:关于比较variable 包子答谢
sas大牛们这个要怎么实现呀sas问题
[合集] 问个SAS的问题请教这种freq 该用什么code算(sas)?Thanks!
相关话题的讨论汇总
话题: proc话题: 1002话题: sql话题: variable话题: a10
进入Statistics版参与讨论
1 (共1页)
t*****l
发帖数: 11
1
我有如下这样一个dataset,每个variable repeat measurement 3-6 次, 想要对所有
variable求它们各自repeat的mean, variable数多于300, 如何用short cut refer
所有variable?
可能很菜鸟的问题, 不过我google了半天也没找到, 恳请指点一二, 如果用data
step 又如何处理?
id v1 v2 v3 ...
1001 1 2 5
1001 1 2 5
1001 1 2 5
1002 3 4 6
1002 3 4 6
1002 3 4 6
1002 3 4 6
...
比如如何修改如下code?
proc sql;
create table t as
select avg (v1 -- v3) as (m1 -- m3) *This can not work..
from work.xx
group by id;
quit;
多谢
p********a
发帖数: 5352
2
proc means data=a mean;
var v1--var300;
output out=b ;
run;
p********a
发帖数: 5352
3
具体参数你自己GOOGLE一下PROC MEANS
g*********o
发帖数: 20357
4
My SAS just expired, so I can't try it. Can you try this yourself?
Instead of (m1 -- m3), put (m1 - m3), because I saw a line of code of
" rename=(a1-a10=base_a1-base_a10) ".
proc sql;
create table t as
select avg (v1 -- v3) as (m1 - m3)
from work.xx
group by id;
quit;
g*********o
发帖数: 20357
5
版主有空帮我看看那个ADJUDICATION问题?谢谢

【在 p********a 的大作中提到】
: proc means data=a mean;
: var v1--var300;
: output out=b ;
: run;

h******e
发帖数: 1791
6
试试把“--”改为“-”。

【在 t*****l 的大作中提到】
: 我有如下这样一个dataset,每个variable repeat measurement 3-6 次, 想要对所有
: variable求它们各自repeat的mean, variable数多于300, 如何用short cut refer
: 所有variable?
: 可能很菜鸟的问题, 不过我google了半天也没找到, 恳请指点一二, 如果用data
: step 又如何处理?
: id v1 v2 v3 ...
: 1001 1 2 5
: 1001 1 2 5
: 1001 1 2 5
: 1002 3 4 6

c*******o
发帖数: 3829
7
You can use SAS even it expired: change your computer's date back to the
period your SAS was licensed and launch SAS.

【在 g*********o 的大作中提到】
: My SAS just expired, so I can't try it. Can you try this yourself?
: Instead of (m1 -- m3), put (m1 - m3), because I saw a line of code of
: " rename=(a1-a10=base_a1-base_a10) ".
: proc sql;
: create table t as
: select avg (v1 -- v3) as (m1 - m3)
: from work.xx
: group by id;
: quit;

t*****l
发帖数: 11
8
谢谢斑竹提醒, 用下面的code能够直接得到我想要得dataset, 不用带很多别的自动
variable
proc means data =aa noprint;
class id;
var v1 -- v3;
output out=bb(drop=_TYPE_ _FREQ_ where =(id ne .)) MEAN= ;
run;
回头再看看proc sql怎么做

【在 p********a 的大作中提到】
: proc means data=a mean;
: var v1--var300;
: output out=b ;
: run;

t*****l
发帖数: 11
9
Thank you, I tried, but it doesn't work. I saw what you mention about the
short-cut in the rename statement too, but seemingly not for calculation in
Proc Sql.
proc sql;
create table Baseline_A_1 as
select subject_id,
a1 as base_a1,
/* .. etc. .. , */
a10 as base_a10
from Scores
where visit=1;
create table baseline_A_2 as
select *
from Scores(rename=(a1-a10=base_a1-base_a10) drop=b:)
where visit=1;
quit;

【在 g*********o 的大作中提到】
: My SAS just expired, so I can't try it. Can you try this yourself?
: Instead of (m1 -- m3), put (m1 - m3), because I saw a line of code of
: " rename=(a1-a10=base_a1-base_a10) ".
: proc sql;
: create table t as
: select avg (v1 -- v3) as (m1 - m3)
: from work.xx
: group by id;
: quit;

1 (共1页)
进入Statistics版参与讨论
相关主题
请教这种freq 该用什么code算(sas)?Thanks!SAS problem ask for help!
sas问题ask for help (urgent): A SAS question
神奇的proc meanssas大牛们这个要怎么实现呀
ask a sum function[合集] 问个SAS的问题
排序的问题,请问高手用SAS怎么做?SAS format 的问题
请教一个用SAS作DATA MERGE的问题请教SAS达人关于编循环regression的问题,多谢!
[提问]怎样提取SAS Dateset的observation number?请教一个SAS SQL的问题
SAS how to change variables' name要面试了,请问实际工作中large data set都是存在那里的?
相关话题的讨论汇总
话题: proc话题: 1002话题: sql话题: variable话题: a10