由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - Need help! 如何用sas做一个n*n的count tabulate
相关主题
新人求问SAS简单问题~~请问一个correlation和regression的问题
SAS code - help needed. 8 个包子酬谢ods rtf startpage=never does not work anymore in SAS9.2?
新人拜山,请教做SAS programmer主要用哪些procedure?Help for freq subset
SAS problem ask for help!data set problem (SAS)--first two will have two(baozi) Happy holiday
sas问题SAS怎么把所要的frequency都display在一个表中?
请教关于SAS表格输出的问题Standardize city names in SAS
SAS 求助, 一个小问题, 包子答谢请教SAS ODS to Excel
请问survey data计算correlation和它的CL的问题怎样得到OBS的值?
相关话题的讨论汇总
话题: proc话题: var话题: sscp话题: tabulate
进入Statistics版参与讨论
1 (共1页)
j*********9
发帖数: 161
1
表达能力不太好,希望大家能看得懂。
n个variable代表n种疾病,1表示有病,“.”表示无此病。observation有3万多。
想最后得到一张n*n的表,能显示各种疾病的count以及任意两种疾病都有的count。我
用proc freq试了半天,能得到数据,就是不能弄成一张满意的表。
Help please!包子虽然不多,愿全部奉送!
D******n
发帖数: 2836
2
u might get it wrong.
it is not a orthogonal partition of the population.
think about this, ppl have diseases, A,B and C.

【在 j*********9 的大作中提到】
: 表达能力不太好,希望大家能看得懂。
: n个variable代表n种疾病,1表示有病,“.”表示无此病。observation有3万多。
: 想最后得到一张n*n的表,能显示各种疾病的count以及任意两种疾病都有的count。我
: 用proc freq试了半天,能得到数据,就是不能弄成一张满意的表。
: Help please!包子虽然不多,愿全部奉送!
:

A*******s
发帖数: 3942
3
market basket/association rules mining

【在 j*********9 的大作中提到】
: 表达能力不太好,希望大家能看得懂。
: n个variable代表n种疾病,1表示有病,“.”表示无此病。observation有3万多。
: 想最后得到一张n*n的表,能显示各种疾病的count以及任意两种疾病都有的count。我
: 用proc freq试了半天,能得到数据,就是不能弄成一张满意的表。
: Help please!包子虽然不多,愿全部奉送!
:

j*********9
发帖数: 161
4
I am sorry that i do not get it.
Do you mean people can not have so many diseases?
My project is based on real data. People are new born babies and disease are all kinds of birth defects. So, this should not be a problem.
Could you give me some idea how to solve it?

【在 D******n 的大作中提到】
: u might get it wrong.
: it is not a orthogonal partition of the population.
: think about this, ppl have diseases, A,B and C.

l****u
发帖数: 529
5
I had made a table like that but needed several steps. There must be
easier
methods.
%macro diseasecount(var);
proc sql;
create table &var as
select "&var" as name, sum(A) as A,sum(B) as B,sum(C) as C ....
from yourdata
where &var.=1;
quit;
%mend;
%diseasecount(A)
%diseasecount(B)
%diseasecount(C)
.
.
.
data final;
set A
B
C......;
run;
j******o
发帖数: 127
6
Check your message.
j*********9
发帖数: 161
7
表达能力不太好,希望大家能看得懂。
n个variable代表n种疾病,1表示有病,“.”表示无此病。observation有3万多。
想最后得到一张n*n的表,能显示各种疾病的count以及任意两种疾病都有的count。我
用proc freq试了半天,能得到数据,就是不能弄成一张满意的表。
Help please!包子虽然不多,愿全部奉送!
D******n
发帖数: 2836
8
u might get it wrong.
it is not a orthogonal partition of the population.
think about this, ppl have diseases, A,B and C.

【在 j*********9 的大作中提到】
: 表达能力不太好,希望大家能看得懂。
: n个variable代表n种疾病,1表示有病,“.”表示无此病。observation有3万多。
: 想最后得到一张n*n的表,能显示各种疾病的count以及任意两种疾病都有的count。我
: 用proc freq试了半天,能得到数据,就是不能弄成一张满意的表。
: Help please!包子虽然不多,愿全部奉送!
:

A*******s
发帖数: 3942
9
market basket/association rules mining

【在 j*********9 的大作中提到】
: 表达能力不太好,希望大家能看得懂。
: n个variable代表n种疾病,1表示有病,“.”表示无此病。observation有3万多。
: 想最后得到一张n*n的表,能显示各种疾病的count以及任意两种疾病都有的count。我
: 用proc freq试了半天,能得到数据,就是不能弄成一张满意的表。
: Help please!包子虽然不多,愿全部奉送!
:

j*********9
发帖数: 161
10
I am sorry that i do not get it.
Do you mean people can not have so many diseases?
My project is based on real data. People are new born babies and disease are all kinds of birth defects. So, this should not be a problem.
Could you give me some idea how to solve it?

【在 D******n 的大作中提到】
: u might get it wrong.
: it is not a orthogonal partition of the population.
: think about this, ppl have diseases, A,B and C.

相关主题
请教关于SAS表格输出的问题请问一个correlation和regression的问题
SAS 求助, 一个小问题, 包子答谢ods rtf startpage=never does not work anymore in SAS9.2?
请问survey data计算correlation和它的CL的问题Help for freq subset
进入Statistics版参与讨论
l****u
发帖数: 529
11
I had made a table like that but needed several steps. There must be
easier
methods.
%macro diseasecount(var);
proc sql;
create table &var as
select "&var" as name, sum(A) as A,sum(B) as B,sum(C) as C ....
from yourdata
where &var.=1;
quit;
%mend;
%diseasecount(A)
%diseasecount(B)
%diseasecount(C)
.
.
.
data final;
set A
B
C......;
run;
j******o
发帖数: 127
12
Check your message.
o****o
发帖数: 8077
13
taking . as 0, this is the SSCP matrix, and can easily be obtained via PROC
CORR
here is an example:
data x;
input x1-x5;
cards;
1 . 1 1 .
. 1 1 1 .
1 1 1 1 1
. . . . .
. 1 . . 1
. 1 . . .
1 . 1 . .
. . 1 . .
. . . 1 .
. . 1 . 1
;
run;
proc corr data=x
out=sscp(where=(_TYPE_="SSCP" & _NAME_^="Intercept") drop=Intercept)
sscp
noprint;
var x1-x5;
run;

【在 j*********9 的大作中提到】
: I am sorry that i do not get it.
: Do you mean people can not have so many diseases?
: My project is based on real data. People are new born babies and disease are all kinds of birth defects. So, this should not be a problem.
: Could you give me some idea how to solve it?

j*********9
发帖数: 161
14
very useful code, easy to apply!
Thank you very much!
And accept Baozi, please!

【在 j******o 的大作中提到】
: Check your message.
j*********9
发帖数: 161
15
That is the easiest way to solve this problem.
Thank you very much!
And, Baozi!

PROC

【在 o****o 的大作中提到】
: taking . as 0, this is the SSCP matrix, and can easily be obtained via PROC
: CORR
: here is an example:
: data x;
: input x1-x5;
: cards;
: 1 . 1 1 .
: . 1 1 1 .
: 1 1 1 1 1
: . . . . .

j*********9
发帖数: 161
16
Now, I do not have any decent Baozi left.
Actually I tried proc tabulate first, which can give me the numbers i want
and they are all in one table, but it has extra columns and rows. So
frustrating....
z**********i
发帖数: 12276
17
收藏拉,谢谢!

PROC

【在 o****o 的大作中提到】
: taking . as 0, this is the SSCP matrix, and can easily be obtained via PROC
: CORR
: here is an example:
: data x;
: input x1-x5;
: cards;
: 1 . 1 1 .
: . 1 1 1 .
: 1 1 1 1 1
: . . . . .

l****u
发帖数: 529
18
学习了
s*r
发帖数: 2757
19
我在ods table里面找了半天没找到,这个和proc glm不一样呀

PROC

【在 o****o 的大作中提到】
: taking . as 0, this is the SSCP matrix, and can easily be obtained via PROC
: CORR
: here is an example:
: data x;
: input x1-x5;
: cards;
: 1 . 1 1 .
: . 1 1 1 .
: 1 1 1 1 1
: . . . . .

1 (共1页)
进入Statistics版参与讨论
相关主题
怎样得到OBS的值?sas问题
[合集] 新手首次发贴 SAS 问题急问,谢谢大家的帮助请教关于SAS表格输出的问题
菜鸟问个sas得问题,关于分数组SAS 求助, 一个小问题, 包子答谢
请教一个SAS问题请问survey data计算correlation和它的CL的问题
新人求问SAS简单问题~~请问一个correlation和regression的问题
SAS code - help needed. 8 个包子酬谢ods rtf startpage=never does not work anymore in SAS9.2?
新人拜山,请教做SAS programmer主要用哪些procedure?Help for freq subset
SAS problem ask for help!data set problem (SAS)--first two will have two(baozi) Happy holiday
相关话题的讨论汇总
话题: proc话题: var话题: sscp话题: tabulate