08-08-2016 12:17 PM
I'm using SAS 9.4.
I have to randomize 100 patients to 2 treatments A and B, considering 2 strata: stratum 1 with 2 levels (a and b) and stratum 2 with 3 levels (x, y and z). But these strata present different levels proportions. For example: a 48% and b 52% and x 75%, y 20% and z 5%.
How can I put in the attached program these percentages?. In the next code I considered same proportions for all levels of strata but I would like to consider these proportions. Could you be so kind to indicate me how to incorporate changes in order to consider the different proportions in the levels of the strata?
* Code (considering same proportions on the different levels):
proc plan seed= 12345678;
bsize=2 ordered ;
length treatment $ 11 CG $ 11 mmse $ 11;
If trt in (1) then treatment = 'A';
else if trt in (2) then treatment = 'B';
If strat1 =1 then mmse = 'a';
else if strat1 =2 then mmse = 'b';
If strat2 =1 then cg = 'x';
If strat2 =2 then cg = 'y';
If strat2 =3 then cg = 'z';
subjid = put(_n_, z3.);
proc report data=random nowindows;
column mmse cg subjid treatment;
define CG / "Setting" style=[just=C cellwidth=15%];
define MMSE / "Setting" style=[just=C cellwidth=15%];
define subjid / "Subject ID" style=[just=C cellwidth=15%];
Thank you in advance,
08-08-2016 02:09 PM
Thank you very much Reeza for your advice.
Using proc survey select: example with 2 strata with 2 levels in stratum1 (a=48% and b=52%) and 2 levels in stratum2 (x=75% and y=25%). In data set B we would have for example treatment B and the rest of patients in data set A would be given treatment A. I Do you think following code is correct?
do n=1 to 100;
if n<=48 then stratum1='a';
if (1 le n le 36) or (49 le n le 78) then stratum2='x';
proc sort data=A;
by stratum1 stratum2;
proc surveyselect data=A method=srs n=(24 26) out=B;
proc print noobs data=B;
08-09-2016 08:49 AM
I have modified the code:
08-13-2016 02:27 PM
I would appreciate if some colleague could tell me if following code is correct. This is an example of using proc survey select with N= 100 individuals for assigning 2 treatments (A and B) but with 2 strata, with 2 levels in stratum1 (a=48% and b=52%) and 2 levels in stratum2 (x=75% and y=25%):
* I create the sample of N=100 with the 2 strata with different proportions of levels;