p********a 发帖数: 5352 | 1 just use the function nmiss(var)
proc sql;
select nmiss(var1),nmiss(var2)...from a;quit; |
|
p********a 发帖数: 5352 | 2 It is easier to use Proc sql; select Nmiss(var1),Nmiss(var2).... |
|
k*******a 发帖数: 772 | 3 不好意思,那个好像也不行,不过你可以先 reshape data比如
data a;
do i=1 to 8;
x=1; y=1;output;
end;
run;
data b(keep=var z);
set a(rename=(x=z) in=inx) a(rename=(y=z) in=iny);
if inx then var='x';
else if iny then var='y';
run;
proc means data=b noprint;
by var;
var z;
output out=c(drop=_freq_ _type_) n=n nmiss=nmiss min=min max=max;
run; |
|
l******m 发帖数: 111 | 4 或者你也可以用nmiss和cmiss 函数
DATA B;
SET A;
ARRAY NUM[*] _NUMERIC_;
ARRAY CHAR[*] _CHARACTER_;
IF NMISS(OF NUM[*]) THEN DELETE;
IF CMISS(OF CHAR[*]) THEN DELETE;
RUN; |
|
w********r 发帖数: 238 | 5 Output dataset 只有5个default statistics variables. 有么有什么简单的办法加一
些其他的,比如nmiss. 网上查了一下,都好复杂。要不然只有单独做 nmiss 的,然后
再 set. |
|
|
E*****n 发帖数: 7961 | 7 Beat
[在 Stevenson (蝌蚪SSSS) 的大作中提到:]
:银行开报了. |
|
S*******n 发帖数: 10009 | 8 J.P. Morgan's revenue falls and misses estimates
Revenue fell to $23.54 billion. Analysts had expected $23.69 billion. |
|
E*****n 发帖数: 7961 | 9 EPS beat 本来就预计revenue miss
估计就这么安全的过了
[在 Stevenson (蝌蚪SSSS) 的大作中提到:]
:J.P. Morgan's revenue falls and misses estimates
:Revenue fell to $23.54 billion. Analysts had expected $23.69 billion.
:........... |
|
B******e 发帖数: 16928 | 10 Looks like WFC is the only bank that will beat expectations. |
|
C*K 发帖数: 400 | 11 摩根大通第三季度每股盈利1.32美元,预期1.37美元,前值1.35美元。
第三季度营收235亿美元,预期240亿美元,前值251亿美元。 |
|
|
B******e 发帖数: 16928 | 13 Yeah, not paying too much attention to PNC, but those with small trading
operations are in general faring well. |
|
x*******u 发帖数: 500 | 14 只想出这个笨办法, 有没有更简单的
data a;
input x y z m n;
cards;
1 2 3 . 4
2 3 4 5 6
1 . 3 5 6
1 3 4 . .
;
run;
proc contents data=a out=out(keep=name); run;
proc sql noprint;
select name into: name separated by ' ' from out;
run;
proc transpose data=a out=b;
run;
data c; set b;
missnum=nmiss(of col1-col4);
run;
data d(where=(missnum=0))
e(where=(missnum>0));
set c;
run; |
|
s*********e 发帖数: 1051 | 15 data two;
set one;
array a{*} _numeric_;
do i = 1 to dim(a);
xyz = a{i};
output;
end;
run;
proc means data = two n nmiss mean;
var xyz;
run; |
|
o****o 发帖数: 8077 | 16 data _null_;
if _n_=1 then do;
length name $ 32;
declare hash h();
h.defineKey('name');
h.defineData('name', 'nmiss');
h.defineDone();
end;
set yourtable end=eof;
array _c{*} _character_;
if _n_=1 then do
j=1 to dim(_c); _x=vname(_c[j]); put _x=;
if dim(_c)=1 then stop;
end;
do j=2 to dim(_c);
if missing(_c[j]) then do;
if h.find(key:vname(_c[ |
|
b******e 发帖数: 539 | 17 proc summary data=xxxx;
var _character_;
output out=test nmiss=;
run; |
|
D******n 发帖数: 2836 | 18 This just simply doesn't work. nmiss is for numerics i guess. |
|
a********s 发帖数: 188 | 19 提示点思路吧。。。
(1)可以先用proc contents输出每个variable name
(2)用 call symput 建立一组macro variables, ex: var1, var2,...
(3) 在proc sql中用DO Loop 算 nmiss(&&var&i)...
这样应该可以实现。 我以前写过一个简单的算每个变量的missing proportion的macro
。找不到在哪里了。。。 相信proc means也很好实现。 |
|
b******e 发帖数: 539 | 20 proc means or proc summary
the following code counts missing values for all numeric variables in your
data set by id:
proc summary data=survey nway;
class id;
var _numeric_;
output out=summ (drop=_type_ _freq_) nmiss=;
run;
proc print data=summ; run; |
|
D******n 发帖数: 2836 | 21 create a .vim directory under you home directory(there is a dot before
vim)
and then create a syntax directory under it
and then create a sas.vim file under the syntax directory
==============sas.vim======================
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case ignore
syn region sasString start=+"+ skip=+\\|\"+ end=+"+
syn region sasString start=+'+ skip=+\\|\"+ end=+'+
" Want region from 'cards;' to ';' to be captured (Bob Heckel)
sy... 阅读全帖 |
|
l*********s 发帖数: 5409 | 22 a stupid solution, transpose then nmiss function |
|
b*****e 发帖数: 223 | 23 use array
Or, does nmiss work for both num or char? I am not sure |
|
n**m 发帖数: 156 | 24 data yourdata;
set yourdata;
if cmiss(of _character_) > 0 or nmiss(of _numeric_) >0 then delete;
run; |
|
|
D******n 发帖数: 2836 | 26 this way works, but stacking data is not that efficient. I came up with this
, just do more data manipulation on the means output.
----------------------------------------------->
data a1;
input x_1 y z weight;
datalines;
1 0 4 0.1
1 0 4 0.5
0 1 1 0.2
0 1 1 0.2
1 0 2 0.1
0 1 2 0.5
1 0 3 0.2
0 1 3 0.2
;
run;
proc means data=a1 noprint;
var x_1 y z;
weight weight;
output out=b sum= mean= nmiss=/autoname;
run;
proc transpose data=b(drop= _type_ _freq_) out=b2;run;
data b2;
... 阅读全帖 |
|
w*******n 发帖数: 469 | 27 if nmiss(of _numeric_) or cmiss( of _character_) then delete; |
|
c*******r 发帖数: 323 | 28 不是用output = 那个,要在result window 里那个table
我想做的是对任意一个table列出所有variables的min max mean n nmiss std |
|