由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - ASK FOR ONE SAS QUESTION
相关主题
求助:data manipulation的一个问题请教:get next record using BY group (SAS code data manipulation)
两个简单的SAS问题a SAS question
如何在1,2,3,4,5中随机选出2个数来?新人求问SAS简单问题~~
SAS,如何从一个大的dataset里面提取部分记录求教proc sql 问题
用SAS sampling的一个问题R重要还是SAS重要?
求教 SAS数据转化non inferiority test for the difference of two proportions in "proc freq" ?
如何将SAS DATA中的变量名改名(不知道原变量名的前提下)SAS code - help needed. 8 个包子酬谢
一个简单的SAS 问题中级SAS问题
相关话题的讨论汇总
话题: test1话题: sas话题: question话题: test话题: data
进入Statistics版参与讨论
1 (共1页)
c****o
发帖数: 69
1
COME ACROSS A PROBLEM DURING WORK.....
SAS DATA SET ARE LIKE:
Name Test1 ..... Test1000
Billy 1 2
.....
....
Actually for all the Test Variable, there are only 3 results: 1,2,3
My question is: how to compute the percentage of each outcome in each Test1
and saved it as the last line in the data set?
For example: For Test1, I want to know the percentage of value=1 in the
total observations (by the way, there are missing values in each Test and I
don't want to include the missing v
a********s
发帖数: 188
2
I do not know exactly what PROC can be used in SAS. But why do not you try
to use PROC FREQ for all variables and save the count number (eg. value=1
for test1) to new data sets. Then, calculate the percentage. GL.
y****n
发帖数: 46
3
%macro tt;
data old;
length name $20;
do j=1 to 1000;
name=catx('_','xx',j);
%do i=1 %to 100;
test&i=mod(floor(ranuni(2)*1000),3)+1;
%end;
output;
end;
drop j;
run;
%mend;
%tt;
data new;
array tt(100) test1-test100;
array ct1(100);
array ct2(100);
array ct3(100);
set old end=eof;
do i=1 to 100;
if tt(i)=1 then ct1(i)+1;
if tt(i)=2 then ct2(i)+1;
if tt(i)=3 then ct3(i)+1;
end;
c****o
发帖数: 69
4
Thanks a lot!!

【在 y****n 的大作中提到】
: %macro tt;
: data old;
: length name $20;
: do j=1 to 1000;
: name=catx('_','xx',j);
: %do i=1 %to 100;
: test&i=mod(floor(ranuni(2)*1000),3)+1;
: %end;
: output;
: end;

c****o
发帖数: 69
5
I did tried actually. but am wondering whether there is a easier way...
thanks

【在 a********s 的大作中提到】
: I do not know exactly what PROC can be used in SAS. But why do not you try
: to use PROC FREQ for all variables and save the count number (eg. value=1
: for test1) to new data sets. Then, calculate the percentage. GL.

1 (共1页)
进入Statistics版参与讨论
相关主题
中级SAS问题用SAS sampling的一个问题
新人拜山,请教做SAS programmer主要用哪些procedure?求教 SAS数据转化
SAS problem ask for help!如何将SAS DATA中的变量名改名(不知道原变量名的前提下)
marketing analyst onsite 一般都怎么考SAS一个简单的SAS 问题
求助:data manipulation的一个问题请教:get next record using BY group (SAS code data manipulation)
两个简单的SAS问题a SAS question
如何在1,2,3,4,5中随机选出2个数来?新人求问SAS简单问题~~
SAS,如何从一个大的dataset里面提取部分记录求教proc sql 问题
相关话题的讨论汇总
话题: test1话题: sas话题: question话题: test话题: data