由买买提看人间百态

topics

全部话题 - 话题: have2
(共0页)
s******y
发帖数: 352
1
来自主题: Statistics版 - 请教用SAS的一个数据处理的问题
DATA HAVE;
INFILE CARDS TRUNCOVER;
INPUT A B C D;
ROWID=_N_;
CARDS;
1
7
3 3
2 5
. 5
. 5 3
. . 4 5
. . 5 8
. . 2 3
. . . 1
;
RUN;
PROC TRANSPOSE DATA=HAVE OUT=HAVE1(WHERE=(NOT MISSING(COL1)));
BY ROWID;
VAR A B C D;
RUN;
PROC SORT DATA=HAVE1;
BY _NAME_ ROWID;
RUN;
DATA HAVE2;
SET HAVE1;
BY _NAME_;
ID+1-(FIRST._NAME_)*ID;
RUN;
PROC SORT DATA=HAVE2;
BY ID _NAME_ ;
RUN;
PROC TRANSPOSE DATA=HAVE2 OUT=WANT(DROP=_NAME_ ID);
BY ID ;
VAR COL1;
ID _NAME_;
RUN;
F****3
发帖数: 1504
2
来自主题: Statistics版 - DATA step能left join吗?
我用SQL是这样搞的:
proc sql;
create table WANT as
select distinct a.*, b.VAR1 , b.VAR2
from HAVE1 as a left join HAVE2 (DROP=link_count) as b
on a.PATIENT_ID = b.PATIENT_ID and a.YEAR = b.YEAR;
quit;
但是应为硬盘容量有限,所以只能用DATA STEP了。请问出来的WANTtable是不是一模一
样的啊?
proc sort data=HAVE1;
by PATIENT_ID YEAR;
run;
proc sort data=HAVE2(keep=PATIENT_ID YEAR VAR1 VAR2);
by PATIENT_ID YEAR;
run;
data WANT;
merge HAVE1 (in=a) HAVE2(in=b);
by PATIENT_ID YEAR;
if a;
run;
F****3
发帖数: 1504
3
非常简单的程序,run了一个下午都没run出来。
Both have1 and have2 have few variables, but many observations.
proc sql;
create table want as
select *
from have1 as a left have2 as b
on b.serie_beg <= a.serie <= b.serie_end;
quit;
把上面left join换成inner join也一样。。。
serie_beg, serie, and serie_end都是上billion的数值(numeric)。请怎么会这么
久啊?
F****3
发帖数: 1504
4
来自主题: Statistics版 - DATA step能left join吗?
真不好意思啊。你说的有重名,请问可以举一个例子吗?
假设Have1 有下面几个variable (400 GB的那个)
hospital_visit_id, date, time, patient_id, document_id
Have2有下面几个variable (800 MB的那个)
patient_id, document_id, diag_date, diag_type
应该就没有问题吧?
如果另外我把前面条件改动,让HAVE1和HAVE2都有一个共同的variable叫comomon_
variable,这种情况就会出现你提到的改动问题吧?谢谢!
s******8
发帖数: 102
5
来自主题: Statistics版 - DATA step能left join吗?
你这种情况是该用hash,假设have2是800M.
data merged;
length var1 var2 $8.;*这里要根据实际情况改,但必须定义var1 var2;
if _n_=1 then do;
dcl hash h(dataset:"have2");
h.definekey("PATIENT_ID","YEAR");
h.definedata("VAR1","VAR2");
h.definedone();
call missing(var1,var2);
end;
set have1;
if h.find() ne 0 then call missing(var1,var2);
run;
m*********n
发帖数: 6098
6
have2
m*********n
发帖数: 6098
7
have2
s*******h
发帖数: 7
8
Hi,
I'm J1-visa and will work in China two years, however, I plan to be
back United States, I just want to know how to calculate 2 years and avoid
some troubles. How to prove I already have2 years period in China, from
time stamps on my passport, is that right, or need any other documents to
send to the U.S. immigration. example, I leave United States: 07/20/2012,
then I get F1-student visa 05/10/2014, and enter the United States at 08/05/
2014 (I-94).
The two years would be from 0... 阅读全帖
w*******y
发帖数: 60932
9
Hi,
I came across this coupon on the FB flash sale for Myshoespot.com. They
are offering $5.00 off any item on the site with coupon code: 1123M
There is only one good deal I found: They have2 Airsoft BB pistols:
https://www.myshoespot.com/p-174-2-airsoft-pistol-spring-bb-guns.aspx
for $7.99. Use the coupon code and the price will be $2.99. Shipping is
free.
One question remains, will someone please tell me why the eff is a shoe
site selling BB guns?
(共0页)