There are observations where the episode ends in control=Yes and I have figured out the programming for that. (not an ideal situation to split the data, but...I did it.)
The drug of interest is LABE. If a different drug, other than LABE was used then the control=XX. Every episode ends with control=Yes, if controlled by LABE or XX if controlled by other drug, but still considered a failure as LABE didn't work.
I do not want a string that reads "80+80" but just used it for explanation.
There are cases where control is no, no, yes, no, no, yes -- these are 2 episodes, I haven't figured programming for that either.
My following crude code gives what I need as the last row, but for pushes it should be 200-40, which I can do later...
data test124; set test123; if desc = "LABE" then pushes+dose; else if desc = "HYDR" then pushesxx+dose; run;
LABE and other drugs will not be mixed within an ID. It will be only LABE and control =yes (maybe few no's in between) or LABE followed by another drug and then control will be xx.
... View more