Thanks!!
I have already figured it out!
Will share the code with everybody^^
data b;
set a;
by id ;
retain bltime;
if first.id then bltime=0;
if amt^=0 then bltime=tsfd;
tad=tsfd-bltime;
run;
ID tsfd dose bltime tad
1 0 50 0...
Because this is multiple dosing(for example, ID=1, dosing 50 when tsfd=0 and dosing 100 when tsfd=10), I want to create a new variable to calculte relative time (consider every dosing time as baseline), so when tsfd=0 and tsfd=10, tad=0
So we have tad:
0 (dosing)
1
5
8
0 (dosing twice)
2
5...
Hi everyone,
I have a question about time issue.
The original dataset has three column:
ID, tsfd(time since first dose), dose(for ID=1, dosing twice,50 at time=0 and 100 at time=10).
Now I want to add another column called "tad"(time after last dose)
I want output like this:
ID tsfd...
Hi everyone,
I have a question about creating duplicate records (but different times) using SAS.
my questions is:
If I have a dataset like
days startdate stopdate
2 01/02/2009 03/02/2009
3 05/02/2009 08/02/2009
5 01/03/2009 06/03/2009
I want to duplicate the first record two times and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.