Hello,
I have to derive aval based on conditional strategies.
"in the following order of priority: 1) Check "SWREL". If aval eq 1: Composite strategy 2 using "EASITOTA" as the source score if swrel = 1 then flg currently will be 'Composite Strategy 2'. if swrel = 0 for all records per subject flag will be blank at this stage
2) Check "RTT1L28D” and “TCM2”. If aval eq 1: Composite strategy 1 using "EASITOTA" as the source score
if either tcm2 or rtt1l28 = 1 along with swrel = 1 then flg will change from "Composite Strategy 2 " to "Composite Strategy 1" .
If swrel,rtt1l28,tcm2 all = 0 for all records per subject then flag will be blank at this stage
2) Check "SWNREL" aval eq 1: While-on-Treatment strategy.
if swnrel = 1 and tcm2 or rtt1l28= 1 then flg will be 'While-on-Treatment'. 3) Apply treatment policy strategy – use data as collected in “EASITOTA”"
If swrel,rtt1l28,tcm2,swnrel all = 0 for all records per subject then flag will be 'treatment policy'
Programming logic "1)If AVAL = 1 for "SWREL" , apply Composite strategy 2 using "EASITOTA" aval. 2) If AVAL equals 1 on either record where "RTT1L28D" or "T2CM", apply Composite strategy 1 using "EASITOTA" aval. 3) If SWNREL equals 1 on the record, apply While-on-Treatment strategy. 4) Apply Treatment Policy strategy using "EASITOTA" aval."
Here is the data in it's merged form with all relevant variables. For context the aval for SWREL, SWNREL, TCM2 and RTT1L28 represent intercurrent events and the score (AVAL) was transposed to the EASITOTA dataset and a value of 1 indicates an intercurrent event occurred and a value of 0 indicates no intercurrent event.
data have;
input PARAMCD $ SUBJID $ AVISITN :8. ADT :$9. AVAL :8. RTT1L28D :8. T2CM :8. SWREL :8. SWNREL :8.;
infile datalines dlm = '|';
datalines;
EASITOTA|1001|20|27APR2022|13.4|0|0|0|0
EASITOTA|1001|30|11MAY2022|13.4|0|0|0|0
EASITOTA|1001|40|26MAY2022|13.4|0|0|0|0
EASITOTA|1001|50|22JUN2022|13.4|0|0|0|0
EASITOTA|1001|60|20JUL2022|13.4|0|0|0|0
EASITOTA|1001|70|31AUG2022|13.4|0|0|0|0
EASITOTA|1002|20|27APR2022|16.4|0|0|0|0
EASITOTA|1002|30|11MAY2022|16.4|0|0|0|0
EASITOTA|1002|40|25MAY2022|16.4|1|0|0|0
EASITOTA|1002|50|22JUN2022|16.4|1|0|0|0
EASITOTA|1002|60|20JUL2022|16.4|1|0|0|0
EASITOTA|1002|70|22AUG2022|16.4|1|0|0|0
EASITOTA|1003|20|07JUN2022|15.8|0|0|1|0
EASITOTA|1003|20|21JUN2022|15.8|1|0|1|0
EASITOTA|1003|30|05JUL2022|15.8|1|0|1|0
EASITOTA|1003|40|02AUG2022|15.8|0|0|1|0
EASITOTA|1003|50|30AUG2022|15.8|0|0|1|0
EASITOTA|1003|60|27SEP2022|15.8|0|0|1|0
EASITOTA|1003|70|25OCT2022|15.8|0|0|1|0
;
run;
Basically I would like to create a flag that assigns the correct strategy to all records per subject so I can further go on to derive aval (based on these strategies below). I was thinking that a conditional dow loop may work here but if there is a simpler approach I would really appreciate it.
... View more