-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathderive_CO.sas
65 lines (56 loc) · 1.58 KB
/
derive_CO.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/******************************************************************************
Author, date: pmbrown, feb2020
Macro name: derive_CO
Description: implement decision rule as per CITRIS-ALI trial
Notes: developed in SAS 9.4
Reference: jama: Only if the smallest P value was less than .02, the
second smallest less than .03, and the largest less than .05
was simulation considered a success
Validation Susanne Bruun on 19th April 2022 at 15:43
******************************************************************************/
*set to missing if died;
data randsampmiss;
set der.randsamp2;
if var42 lt 28 then do;
var1_=.;
var2_=.;
var3_=.;
end;
else do;
var1_=var1;
var2_=var2;
var3_=var3;
end;
run;
ods output KruskalWallisTest=co_pval ;
proc npar1way data=randsampmiss wilcoxon plots=none ;
ods select KruskalWallisTest ;
class trt;
var var1 var2 var3
var1_ var2_ var3_;
by samp;
quit;
data co_pval2;
set co_pval;
if index(variable,'_')=0 then newvar=1;
else newvar=2;
run;
*sort p-values from smallest to largest;
proc sort data=co_pval2;
by newvar samp prob;
run;
*create var indicating sort order and use in subsequent proc transpose ;
data co_pval3;
retain count;
set co_pval2;
by newvar samp prob;
if first.samp then count=1;
else count=count+1;
run;
*thus: pval1 is smallest etc;
proc transpose data=co_pval3 out=der.co_pval (drop=_name_ _label_) prefix=pval;
var prob;
id count;
by newvar samp;
run;
***end***************************************************************************;