zhengbo8 发表于 2013-6-13 11:00 
数据集,附件。
检查数据集中每条观测数值变量有多少个变量是缺失的。
这样就可以了。
谢谢谢谢哈
想了很久 终于想明白了。。
google了下 好像还有个什么N function也可以计算non-missing的量,贴一下——(anyway thanks, zhongbo8)
you can use the N function to determine the number of non-missing values in a list of variables, as illustrated below.
DATA times4 ;
SET times ;
n = N(trial1, trial2, trial3) ;
RUN ;
PROC PRINT DATA=times4 ;
RUN ;
As you see below, observations 1, 5 and 6 had three valid values, observations 2 and 3 had two valid values, and observation 4 had only one valid value.
OBS ID TRIAL1 TRIAL2 TRIAL3 N
1 1 1.5 1.4 1.6 3
2 2 1.5 . 1.9 2
3 3 . 2.0 1.6 2
4 4 . . 2.2 1
5 5 2.1 2.3 2.2 3
6 6 1.8 2.0 1.9 3