Different programmers use different approaches to flag Baseline records. I used two steps (using LB domain in SDTM as an example):
1) To sort the assessment results in dataset LB througth PROC SORT by subject assessment date_time...;
PROC SORT DATA=lb;
BY usubjid lbcat lbscat lbtestcd DESCENDING lbdtc;
RUN;
2) To flag the Baseline value with ABLFL='Y'.
DATA lb(drop=flag); ** drop the temporary variable **;
SET lb;
BY usubjid lbcat lbscat lbtestcd DESCENDING lbdtc;
** variable flag is used to identify if one test has ABLFL marked **;
RETAIN flag;
** flag=0 indicating there is no ABLFL marked yet. **;
IF first.lbtestcd THEN flag=0;
** you can add more conditions in IF logic expressions. **;
** TRTSDT below has the first dosing dates. **;
IF flag=0 and LBDT <= TRTSDT and LBSTRESN ne .THEN DO;
ABLFL='Y'; ** ABLFL='Y' indicates the baseline record. **;
flag=1; ** flag=1 indicating the ABLFL is marked. **;
END;
RUN;
If the same has to be done on Vital signs data where height has been recorded only on first visit i.e @ screening but not in run in period???????
ReplyDeleteThe codes above don't exclude any test, so all test will be flagged, including HEIGHT. If you don't want to flag HEIGHT, just add " and VSTESTCD ne 'HEIGHT' " to the conditions of flagging ABLFL.
DeleteIs there a sample data set on which we can tryout this code?
Deletehow to handle cases where the --STDTC is an incomplete date field?
ReplyDeletein case treatment visit (after baseline visit) meeting the criteria and not baseline visit, do we still flagged as baseline flag?
ReplyDeletegood
ReplyDelete<a href="http://spunksoft.com/course/clinical-sas-training-in-hyderabad/>clinical sas training in Hyderabad</a>
please help how to derive LBBLFL flage in labdata
ReplyDeleteCool and I have a tremendous give: How Much Renovate House house and renovation show
ReplyDelete