-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactg320.sas
63 lines (49 loc) · 1.63 KB
/
actg320.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
/* The AIDS Clinical Trials Group Study 320 */
FILENAME actg '/home/hy15c0/STA5244/actg320sample.csv';
proc import out = work.actg
datafile = actg dbms=csv replace;
getnames=yes;
datarow=2;
run;
proc sort data = actg out = actg;
by tx;
run;
/*Fit an exponential distribution for the primary outcome "time to AIDS defining event or death"
in each of the treatment groups (tx = 0; 1)*/
proc lifereg data = actg;
by tx;
model time*censor(0) = / distribution = exponential;
run;
/*Assess whether the exponential distribution above is reasonable*/
proc lifetest data=actg plots=logsurv notable;
strata tx;
time time*censor(0);
run;
/*Plot the Kaplan-Meier estimators of the survival functions for each of the
treatment groups (tx = 0; 1) and use the log rank test to determine whether
the survival experience for the two treatment groups differs*/
proc lifetest data=actg plots=survival(atrisk cb) notable;
strata tx;
time time*censor(0);
run;
/*Fit a Cox proportional hazards regression model with tx as the sole predictor
and assuming one unspecified baseline hazard function*/
proc phreg data = actg;
class tx (ref = '0');
model time*censor(0) = tx;
run;
/*Fit a Cox proportional hazards regression model with tx as the sole predictor and
allowing for different unspecifed baseline hazard functions for each CD4 strata*/
proc phreg data = actg;
class tx (ref = '0') strat2;
model time*censor(0) = tx;
strata strat2;
run;
/* Fit a Cox proportional hazards regression model with tx, age and ivdrug as pre-
dictors*/
proc phreg data = actg;
class tx (ref = '0') ivdrug strat2;
model time*censor(0) = tx age ivdrug;
strata strat2;
run;
title;