03-04-2023
sandhya88
Calcite | Level 5
Member since
06-26-2021
- 18 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by sandhya88
Subject Views Posted 493 03-02-2023 08:55 AM 543 03-02-2023 07:13 AM 557 02-28-2023 08:07 AM 575 02-28-2023 06:18 AM 341 02-24-2023 03:02 PM 382 02-24-2023 02:55 PM 401 02-24-2023 01:47 PM 2400 02-24-2023 08:08 AM 2465 02-22-2023 07:54 AM 2485 02-22-2023 07:15 AM -
Activity Feed for sandhya88
- Posted Re: FLAG ALL THE RECORDS OF A SUBJECT WITH THE VALUE IF ATLEAST ONE VALUE IN A VARIABLE IS NON MISSI on SAS Programming. 03-02-2023 08:55 AM
- Posted FLAG ALL THE RECORDS OF A SUBJECT WITH THE VALUE IF ATLEAST ONE VALUE IN A VARIABLE IS NON MISSING!! on SAS Programming. 03-02-2023 07:13 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-28-2023 08:07 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-28-2023 06:18 AM
- Posted flagging the last record of a ID within a test when multiple records for an ID per test are seen. on SAS Programming. 02-24-2023 03:02 PM
- Posted Re: Retaining the BASEC value from first record of a subject to all the records of the subject per p on SAS Programming. 02-24-2023 02:55 PM
- Posted Retaining the BASEC value from first record of a subject to all the records of the subject per param on SAS Programming. 02-24-2023 01:47 PM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-24-2023 08:08 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-22-2023 07:54 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-22-2023 07:15 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-22-2023 07:13 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-22-2023 06:07 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-22-2023 05:35 AM
- Posted Re: Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-22-2023 05:11 AM
- Posted Flagging all the records within a id if atleast one record meets the predefined criterion on SAS Programming. 02-21-2023 05:09 PM
- Posted Re: Flagging baseline flag based on multiple conditions on SAS Programming. 02-09-2023 10:12 AM
- Posted Flagging baseline flag based on multiple conditions on SAS Programming. 02-09-2023 05:15 AM
- Liked Re: Difference of a value from one variable and the lead of another value in the same variable?? for Jagadishkatam. 09-20-2021 04:17 PM
- Posted Difference of a value from one variable and the lead of another value in the same variable?? on SAS Programming. 09-17-2021 01:40 PM
-
Posts I Liked
Subject Likes Author Latest Post 1
03-02-2023
08:55 AM
Data have;
input ID$ PARAMCD$ RESULT BASERSLT CRITFL$;
datelines;
004 ALT 0.03 0.03
004 ALT 0.06 0.03
004 AST 0.03 0.03
004 CHOL 0.03 0.03
004 4HCHOL 0.03 0.03
004 ALT 0.12 0.03 Y
004 LIPA 0.09 0.09
005 ALT 0.03 0.03
005 AST 0.06 0.04
005 CHOL 0.03 0.03
005 4HCHOL 0.03 0.03
005 ALT 0.06 0.03 N
005 LIPA 0.12 0.12
;
Data want;
input ID$ PARAMCD$ RESULT BASERSLT CRITFL$;
datelines;
004 ALT 0.03 0.03 Y
004 ALT 0.06 0.03 Y
004 AST 0.03 0.03 Y
004 CHOL 0.03 0.03 Y
004 4HCHOL 0.03 0.03 Y
004 ALT 0.12 0.03 Y
004 LIPA 0.09 0.09 Y
005 ALT 0.03 0.03 N
005 AST 0.06 0.04 N
005 CHOL 0.03 0.03 N
005 4HCHOL 0.03 0.03 N
005 ALT 0.06 0.03 N
005 LIPA 0.12 0.12 N; 1.CRITFL for the ID will have either "Y" or "N" and not a combination and hence if at least one record of ID has a "Y" or "N" or even "" i want to see that being retained to all the other records of the ID. Hope this is a bit helpful and apologies for the attachments. Thanks
... View more
03-01-2023
09:39 AM
/*
OK. Test the following code.
If there was something wrong,post an example.
*/
data have;
Input Id visitn testcd $ result baseresult basefl $ pstbsfl $;
datalines;
1 1 ALT 12 3 . Y
1 2 AST 3 1 . Y
2 1 AST 3 1 Y .
2 2 AST 2 1 . Y
;
run;
proc sql;
create table want as
select *,
case when max(pstbsfl='Y' and testcd='ALT') and
max(pstbsfl='Y' and testcd='ALT' and result>=4*baseresult) then 'Y'
when max(pstbsfl='Y' and testcd='ALT') and
max(pstbsfl='Y' and testcd='ALT' and result>=4*baseresult)=0 then 'N'
when max(pstbsfl='Y' and testcd='ALT')=0 then ' '
else 'X' end as critfl
from have
group by id;
quit;
EDITED.
... View more
02-24-2023
03:07 PM
data want;
set have;
by id;
if last.id then flg='Y'; else flg='.';
run;
If I may be so bold, setting FLG to 'Y' or '.' is not such a good idea; setting FLG to numeric 0 or 1 is not only easier to type, but has other benefits as well (such as computing proportions that are flagged can be done by computing a mean).
... View more
02-24-2023
02:55 PM
Data want;
Input ID $ test$ visitnum basefl$ result$ adt randdt basec$
1 CHOL 1 Y HIGH 17JUN2018 18JUN2018 HIGH
1 CHOL 1 Y LOW 17JUN2018 18JUN2018 HIGH
1 CHOL 1 Y HIGH 18JUN2018 18JUN2018 HIGH
1 CHOL 2 . LOW 24JUN2018 18JUN2018 HIGH;
run; @ballardw Thanks for your response and apologies for so many confusions. Here below is what i meant regarding equally apart and the data is how you have shown in your answer and here above is the data look that i want finally. when I meant equally apart i mean to say that when we calculate the difference between adt and randdt if we get the same value for any two records. Logic that I want here is that: 1. If a ID is having 2 or more records with BASEFL eq ‘Y’ and are equally apart (difference between adt and randdt is same )from randdt then consider worst case (HIGH) as BASEC and retain the value across the ID. 2. If a ID is having 2 or more records with BASEFL eq ‘Y’ and are not equally apart from RANDDT then choose the BASEC from the closest record to RANDDT and retain its value across the ID. TIA again
... View more
02-09-2023
10:12 AM
Hi, thanks for looking at my data here is what i wanted it to look alike id test visit dy targetdy result baselineflg 1 tst1 1 1 1 R Y 1 tst1 1 -29 1 R 1 tst1 1 1 1 S sorry for the text above please consider the closest dy to targetdy. Thanks
... View more
09-18-2021
01:11 AM
By
"difference between dp at number 1 and rp at value at next number".
I think you want the rp test value minus the dp test value for each number. If so, then:
data want;
merge have (where=(tst='dp') rename=test_rt=dp_test)
have (where=(tst='rp') rename=test_rt=rp_test);
by number;
rp_minus_dp=rp_test-dp_test;
drop tst ;
if last.number;
run;
If that's not what you mean, please show what the results would look like for the data you provided.
... View more