由买买提看人间百态

topics

全部话题 - 话题: nlevels
(共0页)
S********a
发帖数: 359
1
来自主题: Statistics版 - 中级SAS问题
这几个nlevels/levels搞得我先后顺序糊涂了,ods output 后面第一个nlevels是SAS
产生的结果,等号后面第二个nlevels是由这个结果产生的sas dataset? 那freq 里的
nlevels是keyword还是文件名?包子已发,谢谢。
ods select nlevels;
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq nlevels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close;

value
S********a
发帖数: 359
2
来自主题: Statistics版 - 中级SAS问题
ods select nlevels;
ods output nlevels=b(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq nlevels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close;
我已经改了等号后面的nlevels为b, 剩余的3个nlevels还有哪个可以改的?还是必须写
成nlevels (比如作为keyword)?
h***x
发帖数: 586
3
来自主题: Statistics版 - 问个sas编程的题
The following codes should works,
say you have dataset named 'aaa' and you want to get rid of the character
variables whose values are all missing,
ods output NLevels=_out_;
proc freq data=aaa nlevels; run;
ods output close;
data _out_;
set _out_;
if NLevels=1 and NMissLevels=1;
run;
proc sql ;
select tablevar into: cvar
separated by ' '
from _out_;
quit;
data aaa;
set aaa(drop=&cvar);
run;
s******y
发帖数: 352
4
来自主题: Statistics版 - 中级SAS问题
给几个包子吧。
data class;
if 0 then set sashelp.class;
do i=1 to 10;output;
end;
stop;
run;
proc format;
value allmiss ._-.z=. other=1;
value $allmiss ' '=' ' other='1';
run;
ods select nlevels;
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq levels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close;
S********a
发帖数: 359
5
来自主题: Statistics版 - 中级SAS问题
请点解一下这个ODS OUTPUT NLEVELS,谢谢,有包子啊:)
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq levels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
s******y
发帖数: 352
6
来自主题: Statistics版 - 中级SAS问题
ods output nlevels=nlevels;
first nlevels is the data object SAS provided.
the second one can be called whatever you want to name it. it is confusing
because i give it the same name as the data object.

SAS
s******y
发帖数: 352
7
来自主题: Statistics版 - 中级SAS问题
ods select nlevels; -can not be changed, object name was SAS supplied.
ods output nlevels= -can not be changed, object name was SAS supplied.
proc freq nlevels; -SAS option for PROC Freq
s******y
发帖数: 352
8
来自主题: Statistics版 - 中级SAS问题
谢谢你的大包子。
ODS LISTING CLOSE;
ods output nlevels=nlevels(keep=TableVar NNonMissLevels where=(
NNonMissLevels=0));
proc freq levels;
format _character_ $allmiss. _numeric_ allmiss.;
run;
ods output close;
ODS LISTING;
s******y
发帖数: 352
9
来自主题: Statistics版 - 中级SAS问题
With ODS, you can request the data objects that created from the SAS
procedures. When you specify NLEVELS option in proc freq, data object
nlevels will be generated. wihtin the dataset, you can get the number of
levels for the varaibles specified in the table statement.
if a varaible dosen't have any value, the Nnonmisslevels (number of non-
missing levels) is 0. otherwise it will be the number of the disticnt value
the variable has.
l**********1
发帖数: 5204
10
来自主题: Biology版 - 如何做microarray的scatter plot图?
pls refer
> posted on FRIDAY, JULY 6, 2012
Fix Overplotting with Colored Contour Lines
I saw this plot in the supplement of a recent paper comparing microarray
results to RNA-seq results. Nothing earth-shattering in the paper - you've
probably seen a similar comparison many times before - but I liked how they
solved the overplotting problem using heat-colored contour lines to indicate
density. I asked how to reproduce this figure using R on Stack Exchange,
and my question was quickly answered b... 阅读全帖
s******y
发帖数: 352
11
来自主题: Statistics版 - 中级SAS问题
我的方法对string 和 number 都适用。
首先用format 使non-missing 的value 使用数值1, missing 为。 或blank。 然后
procfreq with nlevel option. 你得到一个dataset. 如过 NNonMissLevels=0, 那末
这个variable 全部missing.
o****o
发帖数: 8077
12
来自主题: Statistics版 - 老问题如何产生missing table
use hash table to store the missing counts for both numeric and char vars,
hash key is variable's name and hash data are the name and the counts
set up array _n{*} _Numeric_;
array _c{*} _Character_;
loop through both array, using vname to check the name of the array elements
, and using missing() to check if it is missing, no matter char or num
variable. If this is the first time this variable is encountered, add to
hash, else replace
done
better output format than PROC FREQ nlevels
p***r
发帖数: 920
13
one datasets, 100 column, num or char,
how to produce a table giving # of missing values for each column such as
what be given from
proc freq nlevel;
d******9
发帖数: 404
14
来自主题: Statistics版 - 用 sas 分组问题
Use Proc Sort and data step.
proc sort data= sashelp.air out=B;
by air;
run;
data C;
set B NOBS=N;
by air;
if _N_ LE N*0.3 then group=1;
else if _N_ LE N*0.7 then group=2;
else group=3;
run;
proc freq data=C nlevels;
tables group/missing;
run;
(共0页)