由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS question: count non-missing value for different variables
相关主题
请教SAS LABEL问题。弱问一个SAS里面求adjusted means的问题
SAS问题来了Please help with a SAS macro
请教flag问题ask for help (urgent): A SAS question
请教proc sql处理missing value的问题SAS question,thanks!
[合集] how to calculate column sum not row sum in SAS? thanks a losas proc report的问题
[合集] How to specify a variable as missingSAS question using PROC SQL 高手请进, 包子答谢
A SAS question问个PROC SQL中INNER JOIN的问题
SAS question - baozi另外请教rtf 文件中 控制pagebreak
相关话题的讨论汇总
话题: variables话题: count话题: vara话题: missing话题: sas
进入Statistics版参与讨论
1 (共1页)
g*******y
发帖数: 380
1
Hi,all
I have a question as below:
I want count the total number of non-missing value for several variables by
year.
Suppose the dataset looks like this:
year varA varB varX varP....
I know I can do proc freq...; tables year*varA;
or proc sql;.. count(varA) as..;group by year;...
But how can I do it for several variables at once and get a single table?
Thank you in advance.
g*******y
发帖数: 380
2
I got it. Just use proc means. Sorry to bother others, I was scared that I
might need use array or macro.
Thank you anyway.
p********a
发帖数: 5352
3
It is easier to use Proc sql; select Nmiss(var1),Nmiss(var2)....
p********a
发帖数: 5352
4
or just N(var1),N(var2) for non-missing
g*******y
发帖数: 380
5
Thank you very much! BZ is always so nice.
I just have one more question:
It works well for my data b/c I only interested in 6 variables.
What if I have hundreds of variables and want count non-missing value for
each one of them? How can I avoid using a long list of variables?
p********a
发帖数: 5352
6
THen you have to use macro. It is something like select variable names from
the dictionary tables and then output them into macro variables
1 (共1页)
进入Statistics版参与讨论
相关主题
另外请教rtf 文件中 控制pagebreak[合集] how to calculate column sum not row sum in SAS? thanks a lo
怎样储存我想要的proc means 的结果?[合集] How to specify a variable as missing
请问如果用SAS 解决这个问题A SAS question
请教关于SAS表格输出的问题SAS question - baozi
请教SAS LABEL问题。弱问一个SAS里面求adjusted means的问题
SAS问题来了Please help with a SAS macro
请教flag问题ask for help (urgent): A SAS question
请教proc sql处理missing value的问题SAS question,thanks!
相关话题的讨论汇总
话题: variables话题: count话题: vara话题: missing话题: sas