- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to create a dummy randomisation list to randomly assign 2 treatments for pat id's. i found many examples but if i get a new pat id then the program should randomly assign one treatment and not change the existing treatment groups. is there any existing program which does or an example would be appreciated. assigning trt A and trt B like below
pat_id trt
101 trt A
102 trt B
103 trt B
104 trt A
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Keep a dataset with the existing values, and randomize only the new ones:
data have;
infile cards dlm=',';
input pat_id $ trt $;
cards;
101,trt A
102,trt B
103,trt B
104,trt A
;
run;
data add;
input pat_id $;
cards;
105
;
run;
data want;
set
have
add
;
if trt = '' then trt = ifc(rand('normal',1) > .5,'trt A','trt B');
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Kurt_Bremser: I think you mean the 'uniform' distribution, not the 'normal' distribution (for an allocation ratio of 1:1).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How do you get a new patient?
Without knowing the program you use for the initial assignment of treatments, it is hardly possible to suggest something useful, except for the most obvious: exclude the observations with non-missing trt variable when assigning trt.