由买买提看人间百态

topics

全部话题 - 话题: transpose
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
y****n
发帖数: 46
1
来自主题: Statistics版 - 请教用SAS的一个数据处理的问题
data a;
input A 4. B 4. C 4. D 4. ;
datalines;
1
7
3 3
2 5
5
5 3
4 5
5 8
2 3
1
;
run;
proc transpose data=a out=b prefix=n;
var a b c d;
run;
data c;
array xx{10} n1-n10;
set b;
rec=0;
do i=1 to 10;
if xx(i)>=0 then do;
new=xx(i);
rec+1;
output;
end;
end;
keep rec _name_ new;
run;
proc sort data=c;
by rec _name_;
run;
proc transpose data=c out=d(drop=_name_ rec);
by rec;
... 阅读全帖
d******9
发帖数: 404
2
来自主题: Statistics版 - sas 编程 - data manipulation
这个是 rotate 吧,比 transpose 容易多了,可以不用 Proc Transpose, 只需要
data step 就行。
Data B;
Set A;
By date seriesNo;
Array Z (3) _temporary_ ("A","B","C");
Array T(3) TypeA TypeB TypeC;
If first seriesNo then do I=1 to dim(T);
Type=Z(I);
Amount=T(I);
if Amount=. then delete;
output;
end;
run;
o****o
发帖数: 8077
3
来自主题: Statistics版 - 老问题如何产生missing table
think out of box, you can:
first transpose, then use PROC FREQ:
proc format ;
value $charmiss
' '='missing'
other='Non-Miss'
;
run;
data test;
array _c{*} $ c1-c5;
do id=1 to 20;
do j=1 to dim(_c);
if ranuni(5555)<0.2 then _c[j]=' ';
else _c[j]='A';
end;
output;
drop j;
end;
run;
data testv/view=testv;
set test;
id=_n_;
run;
proc transpose data=test out=test_t;
by id;
va... 阅读全帖
R*********i
发帖数: 7643
4
来自主题: Statistics版 - SAS how to change variables' name
After transposing the var names are changed to values in a new var (_name_),
you can add _30 at the end of the new var, e.g. name1=compress(_name_)||'_
30'. And then transpose back to the original structure using name1 as the ID
var.
T*******I
发帖数: 5138
5
一个有用的SAS code,用于在同一空间里画两个分布曲线。
data test;
drop i;
do group='A','B';
do i=1 to 10;
x=20+ 8*rannor(12345);
output;
end;
end;
run;
proc print; run;
proc transpose data=test out=test2;
by group;
var x;
run;
proc transpose data=test2 out=test3(drop=_name_);
id group;
run;
proc print; run;
ods listing close;
ods html;
proc sgplot data=test3;
density A / lineattrs=(color=red pattern=1) legendlabel='A';
density B / lineattrs=(color=blue pattern=2) legendlabel='B';
xaxis label='Normal Curves';
run;
ods h... 阅读全帖
o****o
发帖数: 8077
6
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
data _xxx;
input var1 var2 var3 var4;
cards;
2 4 6 7
4 9 7 6
5 2 1 1
7 3 7 3
;
run;
proc transpose data=_xxx out=_xxx2;
run;
proc means data=_xxx2 noprint;
var col1-col4;
output out=_xxx3(keep=v1-v4)
maxid(col1(_name_)
col2(_name_)
col3(_name_)
col4(_NAME_))= v1-v4/autoname;
run;
proc transpose data=_xxx3 out=_xxx3t;
var v1-v4;
run;
d... 阅读全帖
d******9
发帖数: 404
7
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
I just work out another method to do it by using Proc Transpose + Proc SQL +
Macro. It works fine although more complicated.

data A;
input A B C D;
cards;
2 4 6 7
4 9 7 6
5 2 1 1
2 9 3 5
3 5 6 0
1 8 16 4
;
run;
proc transpose data=A out=B;
var _numeric_;
run;
%macro max;
%local I;
proc sql;
select count(*) into: N
from A;
quit;
%let N=&N;
%do I=1 %to &N;
proc sql;
create table max_col&I as
select "&I" as Obs, max(col&I) as max, _Name_ as ... 阅读全帖
k*******a
发帖数: 772
8
来自主题: Statistics版 - 神奇的proc means
嗯是挺奇怪的,不过可以加一个 proc transpose就可以了
比如output的dataset是a
proc transpose data=a out=b;
var x y;
id _stat_;
run;
D******n
发帖数: 2836
9
来自主题: Statistics版 - 神奇的proc means
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;
... 阅读全帖
s****a
发帖数: 296
10
来自主题: Statistics版 - question about longitudinal data
Hello, sorry I cannot type in Chinese here. Please bear with me.
I have a question about analyzing longitudinal data.
Say I have repeated meaurements on both dependent(DV) and independent (IV)
variables.
My data in long-format looks like:
Subject time DV IV Cov1 Cov2
1 0 y10 x10 a10 b10
1 1 y11 x11 a11 b11
1 2 y12 x12 a12 b12
1 3 y13 x13 a13 b13
2 0 y20 x20 a20 b20
2 1 y21 x21 a21 b21
2 2 y22 x22 ... 阅读全帖
p***r
发帖数: 920
11
or you can do it in another brutal way
*WIDE TO LONG;
PROC TRANSPOSE DATA=data1 OUT=data2;
BY var_id;
VAR _ALL_;
RUN;
data data3;
set data2;
log_var=log(col1);
run;
*LONG TO WIDE;
PROC TRANSPOSE DATA=data3 OUT=data4
BY var_ID;
ID variable;
VAR log_var;
RUN;
o****o
发帖数: 8077
12
来自主题: Statistics版 - 请问sas如何做两万次ttest不崩溃?
作T检验,只需要三个统计量嘛,N,MEAN,STD
先求summarized statistics,再用BY-processing。跑得时间不见得少,不过至少不会
崩溃。而且这个用BY-PROCESSING可以很容易并行,最后合并结果也很容易。
134
135
136 options fullstimer;
137 data class;
138 set sashelp.class;
139 array col{20000};
140 do j=1 to dim(col); col[j]=rannor(0); end;
141 drop j;
142 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 20005 variables.
NOTE: DATA statement used (Total process time):... 阅读全帖
k*******a
发帖数: 772
13
来自主题: Statistics版 - 问个SAS问题
transpose应该可以把,try
proc transpose data=a out=b;
by id;
id class;
var cost;
run;
a***d
发帖数: 336
14
来自主题: Statistics版 - sas大牛们这个要怎么实现呀
I am new to SAS too. If your data is not too big, here is a tedious way:
proc sql;
create table C as
select a.*, b.*
from A, B;
quit;
proc transpose data=C out=C1;
by id distance;
var nu;
run;
proc transpose data=C out=C2;
by id distance;
var ran;
run;
data D;
merge C1 C2;
by id distance;
drop _NAME_
run;
p***r
发帖数: 920
15
i like more brutal one
transpose wide -> long
all variable char -> numeric
transpose long -> wide
f******u
发帖数: 250
16
来自主题: Statistics版 - 一个SAS初级问题。。。菜鸟求教
data a;
input year ID$ V1 V2;
cards;
2001 A 1 2
2001 B 3 4
2001 C 5 6
2002 A 1 2
2002 B 3 4
2002 C 5 6
;
run;
proc sort data=a;by id;run;
proc transpose data=a out=b1 prefix=v1_ name=name1;
by id;
id year;
var v1;
run;
proc transpose data=a out=b2 prefix=v2_ name=name2;
by id;
id year;
var v2;
run;
data final(drop=name1 name2);
merge b1 b2;
by id;
run;
j*****g
发帖数: 36
17
来自主题: Statistics版 - 重新安排变量的问题
proc transpose data = dataset0 out=dataset1 name=variable;
by farm year land;
var var1-var3;
drop _label_;
run;
proc sort data = dataset1;
by farm land variable year;
run;
data dataset2(drop = variable year); set dataset1;
newId = catx("_", variable, year);
run;
proc transpose data = dataset1 out =dataset2;
by farm land;
id = newId;
var = col1;
drop _name_ _label_;
run;
l*******s
发帖数: 437
18
来自主题: Statistics版 - 如何把取值为1的column列出来?
有组数据是把每个人的疾病都列出来,每种疾病都对应一个column, 取值只有0 或者1
,1代表此病人有这种疾病,大概有100个column的样子,请问下如何用SAS把每个病人
的每种疾病都能列出来?
谢谢!数据很大,所以不想用transpose的方法(还不知道transpose行不行)。
v********9
发帖数: 35
19
来自主题: Statistics版 - 请问关于交易量的一个SAS编程问题
可不可以先用PROC TRANSPOSE, BY INVESTOR DATE;
让后用ARRAY 进行两两比较。
不知道PROC TRANSPOSE这个耗不耗时间和内存
P****D
发帖数: 11146
20
来自主题: Statistics版 - SAS 求助
如果这是实际情况的话,把数据transpose成每个组的每个测试都是一个独立variable
、每个observation是一个人的样子,好比这样:
tester g1m1 g1m2 g2m1
1 Y N Y
然后就很简单了。
如果实际上测试非常多,就不要transpose了,保持数据是long,把测试单列成一个
variable,然后用proc sql的sum。
m******r
发帖数: 1033
21
来自主题: Statistics版 - Re: 如何快速的将单行分成多行
基本没这种可能。 不知道JMP能不能做,他和R有点类似。
你避免proc transpose的方式不太对。 SAS的特点就是用各种过程外加选项代替编程。
proc transpose可以说是非常基本的东西,实现的功能又是很直观的,写起来只有几行
命令 不太清楚你为什么不喜欢它。
w*********g
发帖数: 30882
22
华为海思64位手机晶片Kirin 930开始试产,为世界上首颗16纳米手机芯片,领先高通
三星一代
来源: 水里 于 2014-08-14 07:36:15 [档案] [博客] [旧帖] [给我悄悄话] 本文已被
阅读:653 次 (4253 bytes)
字体:调大/重置/调小 | 加入书签 | 打印 | 所有跟帖 | 加跟贴 | 当前最热讨论主题
台积电加速16nm FinFET产量 海思麒麟930首发
中国电子报、电子信息产业网  发布时间:2014-08-14
为拉开与英特尔及三星之间的技术差距,台积电开始加快16nm FinFET制程进入量产速
度,并提前一季度在第3季开始进行试产,而且首颗产品是海思(Hisilicon)的64位元手
机晶片Kirin 930。业界看好台积电在16nm的领先优势,将成功稳固苹果下世代A9处理
器代工订单。
台积电日前召开季度例行性董事会,会中核准资本预算共新台币910.3亿元,主要用途
包括了用来扩充先进制程产能,转置部分逻辑制程产能为多种特殊制程产能,兴建厂房
、安装洁净室、及扩充先进封装产能,以及包括第4季的研发资本预算与经常性资本预
算... 阅读全帖
S*******l
发帖数: 4637
23
“印尼总统长得像奥巴马,所以他是奥巴马的兄弟”这句话的逻辑。
这就充分说明你是门外汉,根本就没有对进化论有专业了解,只是民科理解,民科逻辑
批判,所谓无知无畏也。
遗传学上有无法辩驳的分子水平证据,多物种有common ancestor. 比如考察
transposable elements 的随机位点的遗传等等。
门外汉就是门外汉.好像初中生非说相对论听着没逻辑,所以一定是错的。
S*******l
发帖数: 4637
24
很明显你的生物基础只有中学水平。
其他更强证据是需要专业知识才能明白的。比如transposeable elements, 逆转录病毒
之类。
这个主题下的所谓对进化论的批评,一是门外汉的妄言,一是对科学这个概念的错误理
解,一是充满了逻辑错误而不自知。
x********e
发帖数: 35261
25
来自主题: Military版 - 一道趣味数学题
我这方面不是专家,简单说说,有不正确的地方欢迎指正。Y染色体上主要积累了
transposable elements,可用于父系追踪,但TE本身也是在进化的,精确度没那么高
。好像有人专门研究这个,我记不太清了,要查一下。

发帖数: 1
26
来自主题: Military版 - 科普一下张量吧
列吧 当然行也可以 transpose不改变determinant
w********2
发帖数: 632
27
来自主题: Military版 - gmo食品最大的问题
Mobile genetic elements
MGEs are non-essential (accessory) genomic elements composed of genes and
structural features that facil- itate their spread both within and between
organisms (Doolittle and Sapienza, 1980; Orgel and Crick, 1980). They are
found in the genomes of all prokaryotes and eukaryotes. MGEs share many
features and often share a common ancestry with viruses. The main difference
is that viruses are usually capable of extracellular persis- tence.
MGEs, including defective forms, are... 阅读全帖
h******l
发帖数: 422
28
转换成2d array然后用transpose就可以了。
给你举例:
|别|吗|大
|烦|。|家
|我| |好
H**U
发帖数: 1814
29
来自主题: USANews版 - 这篇文章分析的不错
https://theconservativetreehouse.com/2016/08/16/hillary-holds-voter-
registration-drive-in-west-philadelphia-why/
In 2008 the Democrat increase in vote participation (primary to general) was
an increase of 74.69%.
38,111,341 primary voters (Clinton V Obama)
66,578,783 general election voters (Obama)
Diff + 28,467,442 (+74.69%)
In 2008 the Republican increase in vote participation (primary to general)
was an increase of 164.58%
21,971,470 primary voters (McCain v Romney)
58,132,353 general electi... 阅读全帖
j*********r
发帖数: 24733
30
左臂这下尴尬了,人是黑人女性,又不能批斗啊,咋办?
Kara McCullough of the District of Columbia, was asked during Sunday night's
pageant whether she thinks that affordable health care for all U.S.
citizens is a right or a privilege. She said it is a privilege.
"As a government employee, I'm granted health care and I see firsthand that
for one to have health care, you need to have jobs," the 25-year-old shared.
Later in the competition, she was also also asked what she considers
feminism to be and whether is she considers... 阅读全帖
j*********r
发帖数: 24733
31
来自主题: USANews版 - MissUSA:I Stand Behind What I Said
这姑娘真不错,赞一个!
Newly-crowned Miss USA Kara McCullough appeared on "Fox & Friends" this
morning to react to the backlash over her responses during the question
rounds of Sunday night's competition.
McCullough, who was representing the District of Columbia, was asked whether
she thinks that affordable health care for all U.S. citizens is a right or
a privilege. McCullough said it is a privilege.
McCullough was also asked to explain what she considers feminism to be and
whether she considers herself f... 阅读全帖
i********r
发帖数: 12113
32
把钥匙都收了
[在 transpose (人生如水) 的大作中提到:]
:我也是晚了两天提车的,当时抄了Mileage
:不过dealer真想干啥你也没办法知道……我看那个Dealer挺大的貌似靠谱
,就没管了
:warranty
g****7
发帖数: 192
33
prediction model是: D_v/D_t = f(v,t) (参见http://en.wikipedia.org/wiki/Diffusion_equation), 向后对时间积分,预报将来状态.
先做些假定,再两边求矩阵transpose, 推两三页纸吧,可以推出对0时刻的自己定义的
penalty function的积分,t=-1,t=-2按这个顺序出来结果,所以看起来似乎是向历史积
分. 积分结果的含义就是penalty function对v的导数.
prediction model十几年来一直在发展了,可以说很成熟. 后边的才开始起步,我是第二
批做的之一,大家从不同角度完善. 应该以后的十几年会不断完善起来.
H*******k
发帖数: 894
34
来自主题: Faculty版 - 请教一个excel表格插值问题
copy --> paste special 然后选transpose.
k*****i
发帖数: 2373
35
来自主题: FleaMarket版 - error message for amazon promotion code
【 以下文字转载自 ebiz 讨论区 】
发信人: kanlezi (hehe), 信区: ebiz
标 题: error message for amazon promotion code
发信站: BBS 未名空间站 (Wed Nov 25 14:18:57 2009, 美东)
got this error message when I applied amazon promotion code
Erro Message:
Important Message
There's something wrong with the gift certificate/card claim code you
entered. Please check for transposed digits, omitted digits, and similar
errors.
any one knows why?
thanks
w******i
发帖数: 1476
36
来自主题: JobHunting版 - 一个很全SAS Interview Q. List [ZT]
SAS Interview Questions from http://www.sconsig.com/
Very Basic
What SAS statements would you code to read an external raw data file to a DATA
step?
How do you read in the variables that you need?
Are you familiar with special input delimiters? How are they used?
If reading a variable length file with fixed input, how would you prevent SAS
from reading the next record if the last variable didn't have a value?
What is the difference between an informat and a format? Name three informats
or format... 阅读全帖
m*****f
发帖数: 1243
37
来自主题: JobHunting版 - matrix question
to get the row, multiply matrix with a nx1 vector with all 1.
to get the column, do the same with its transpose matrix
the all-1/0-row/columns are recorded as n/0 in the result vector
x******3
发帖数: 245
38
来自主题: JobHunting版 - 请教一道面试题
linear programming, simplex method
assume given array A[1:n], each value is a coin value
need to compute x[1:n], each value is a integer >= 0, equals to the number
of a particular coin
solve this minimization
x[1]+x[2]+...+x[n]
subject to
x >= 0
A*transpose(x) = amount
g*****u
发帖数: 298
39
来自主题: JobHunting版 - 面试题:transpose a matrix in place
matrix用连续内存存储。
怎么样做?
j********9
发帖数: 603
40
来自主题: JobHunting版 - 面试题:transpose a matrix in place
啥叫连续内存存储?一个一维数组?二维数组转一维数组 a[i][j] = a[i*width+j]。
转置的话a[i][j] <==> a[j][i]
Type temp = a[i*width+j]; a[i*width+j] = a[j*height+i]; a[j*height+i] =
temp;
y*c
发帖数: 904
41
来自主题: JobHunting版 - Google经典题目一问
1. O(nlogn)
divide and conquer
abcd1234 -> ab12cd34 -> a1b2c3d4
T(n) = O(n) + 2T(n/2) -> O(nlgn)
2 O(n)
This is just like matrix transposition using O(1) space.
If we use row major, the absolute position for a[i][j] is i*n + j. After
transposing, it goes to j* m + i = i'*n + j', which in turn will go to j'* m
+ i' and so on. There is a paper on the proof.
y*c
发帖数: 904
42
来自主题: JobHunting版 - Google经典题目一问
What I described is a general case, which works for any matrix, including
your 2 rows problem. If you want O(n) algorithm, I think that's the way to
go.
This is the paper.
Transposing a Matrix without Incurring Additional Storage
c**********6
发帖数: 105
43
店面一次 然后去他家onsite(非常规,怎么非常规 请看下面)
两个SDE一起面 一人一道题 感觉像在敷衍 总共不到50分钟
遇到一个VT的哥们儿
就两个intern 估计是二选一
现在还没回消息 估计杯具了 顺便恭喜他了下 :-)
史上最弱面经:
NO1. 之前店面:
1. C中的static
2. shallow copy vs deep copy
3. 给定一个数组(已知数值在0-9范围)计算frequency
4. 定义一个global variable和local variable,不赋值,问输出值各位多少
NO2. onsite
1. 用什么数据结构表示一个图像(RGB)
如何flip这个矩阵(实际上是transpose)
2. 25匹马
K******g
发帖数: 1870
44
来自主题: JobHunting版 - 请教programming pearls上的题目(2)
这个题目是Column2的第7题。
大概意思是transpose一个matrix。个人觉得把(x,y)与(y,x)交换一下不就得了,复杂
度就是把matrix遍历一遍。
但是答案给出一个很“novel”的解法,先把matrix按照column sort一遍,然后在每个
相同的column里按row sort一遍。这个方法的确有意思,但是复杂度明显比前一个方法
大啊。
我实在不知道这道题的玄机在哪里。请看明白的指点一下。多谢了
p******r
发帖数: 2999
45
来自主题: JobHunting版 - 问个array in place operation的题目
相当于inplace matrix transpose
i**********e
发帖数: 1145
46
来自主题: JobHunting版 - facebook的一道题
这个题目恐怕不是面试能解出来的。
通常面试就考考你的反应,和一些思路。
你能一次写对 in place 旋转 N*N matrix 而又没有 bug 的话已经很不错了。
(Assume 你不能 transpose 再 reverse)
r********t
发帖数: 395
47
来自主题: JobHunting版 - facebook的一道题
1 2 3
4 5 6
7 8 9
10 11 12
transpose it:
1 4 7 10
2 5 8 11
3 6 9 12
then make it horizontally reverse:
10 7 4 1
11 8 5 2
12 9 6 3
done
b*******y
发帖数: 232
48
来自主题: JobHunting版 - 再问一个算法题。
需不需要用到 At*Bt = (BA)t t= transpose?
b********g
发帖数: 43
49
来自主题: JobHunting版 - 题目都答对了,竟然都没offer?
那天太神勇了。。主要都是常见题。。
1. two sum, sorted and unsorted version
2. reverse K group linked list
3. binary search tree(lowest common ancestor), extend to binary tree case
4. find unnecessary classes to compile a class in a package .
5. reverse a sentence word by word "I am joe" ---> I ma eoj
6. permutation of a string, I wrote the recursive way first and next_
permutation implementation after that.
7. intersection of two sorted array
8. rotate of a matrix, NxN case, I use transpose, NxM case, I use repl... 阅读全帖
t*****h
发帖数: 137
50
来自主题: JobHunting版 - 请教 rotate the image
In place matrix transpose is not a trivial question. Check wikipedia
http://en.wikipedia.org/wiki/In-place_matrix_transposition
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)