由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - help for SAS code
相关主题
help:data manipulationmixed model question
Another SAS questionSAS QUESTION:how to capture the last nonmissing observation?
问SAS code怎么写SAS quarter calculation question
请教大家一个SAS问题SAS 高手请帮忙
SAS lag function question线性回归的SAS编程疑问
a question about visit window calculation请教两个关于SAS的问题
Put an order variable in a smart way in SAS一个很疑惑的SAS日期问题
help for sas codeSAS base 87% pass today
相关话题的讨论汇总
话题: visit话题: 2010话题: visits话题: ddmmyy10话题: date
进入Statistics版参与讨论
1 (共1页)
a********a
发帖数: 346
1
How can I transfer the data structure from one to two? Basically I want to
get the visit date difference for other visits to visit 0, and value
difference for other visits to visit 0. Thanks
data one;
input id visit date ddmmyy10. value;
format date ddmmyy10.;
datalines;
1 0 1/1/2010 0.5
2 0 3/1/2010 0.8
2 2 5/1/2010 1.5
2 4 7/1/2020 0.3
3 0 4/5/2010 1
3 2 6/5/2010 0.9
;
r
f********t
发帖数: 117
2
select *, a.visit as visit1, b.visit as visit2,
a.date as date_start, b.date as date_end, a.value as value1, b.value as
value 2
from (select * from one where visit = 0) a
left join one b on (a.id = b.id and b.vist > 0 )
Ii dont have sas, but idea is the same. list all first visit, and find all
other visits after the first visits for the id. and align them on the same
row. that is what left join is good for.
a********a
发帖数: 346
3
Thanks a lot.
1 (共1页)
进入Statistics版参与讨论
相关主题
SAS base 87% pass todaySAS lag function question
weird SASa question about visit window calculation
SAS helpPut an order variable in a smart way in SAS
问一个简单的SAS问题,多谢help for sas code
help:data manipulationmixed model question
Another SAS questionSAS QUESTION:how to capture the last nonmissing observation?
问SAS code怎么写SAS quarter calculation question
请教大家一个SAS问题SAS 高手请帮忙
相关话题的讨论汇总
话题: visit话题: 2010话题: visits话题: ddmmyy10话题: date