由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS problem ask for help!
相关主题
help for a sas questionSAS -proc transpose 急问!
SAS code - help needed. 8 个包子酬谢新人求问SAS简单问题~~
请教用SAS的一个数据处理的问题新人拜山,请教做SAS programmer主要用哪些procedure?
sas问题[合集] 用SAS生成表格,怎么弄比较好?
很挑战的data transformation problem help求教 SAS数据转化
神奇的proc means请教一个SAS问题
跪求SAS大牛们一个简单问题求教proc sql 问题
如何将SAS DATA中的变量名改名(不知道原变量名的前提下)怎么用SAS做加减乘除
相关话题的讨论汇总
话题: sas话题: else话题: proc话题: data话题: run
进入Statistics版参与讨论
1 (共1页)
y***e
发帖数: 6
1
I have this following dataset,
ID A B C
1 1 0 1
2 0 1 0
3 . 1 0
4 0 1 .
5 . . 0
I want to make a table that count the number of 1s and 0s in A, B, and C.
Looks like this,
A B C
1 1 3 1
0 2 1 3
I know I should use proc freq with the "list" option. But the SAS returns to
me the same format with or without the list option....
Please help! Thanks a lot!
k*******a
发帖数: 772
2
data a;
input ID A B C;
datalines;
1 1 0 1
2 0 1 0
3 . 1 0
4 0 1 .
5 . . 0
;
run;
proc transpose data=a out=b;
by id;
var a b c;
run;
proc freq data=b;
table col1*_name_;
run;
d******9
发帖数: 404
3
We can also use data step to do it, without transpose:
Data B (drop=ID A B C);
Set A End=EOF;
If A=1 then A_1 +1;
Else if A=0 then A_0 +1;
If B=1 then B_1 +1;
Else if B=0 then B_0 +1;
If C=1 then C_1 +1;
Else if C=0 then C_0 +1;
If EOF=1 then output;
Run;
G**7
发帖数: 391
4
According to Ron Cody, you can use "proc tabulate' to count missing and
nonmissing values for both character and numeric variables.
1 (共1页)
进入Statistics版参与讨论
相关主题
怎么用SAS做加减乘除很挑战的data transformation problem help
sas大牛们这个要怎么实现呀神奇的proc means
one quick question about concatenating data in SAS跪求SAS大牛们一个简单问题
Please help with a SAS macro如何将SAS DATA中的变量名改名(不知道原变量名的前提下)
help for a sas questionSAS -proc transpose 急问!
SAS code - help needed. 8 个包子酬谢新人求问SAS简单问题~~
请教用SAS的一个数据处理的问题新人拜山,请教做SAS programmer主要用哪些procedure?
sas问题[合集] 用SAS生成表格,怎么弄比较好?
相关话题的讨论汇总
话题: sas话题: else话题: proc话题: data话题: run