-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomework+3+model+fitting.sas
95 lines (78 loc) · 3.31 KB
/
Homework+3+model+fitting.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
libname t "/folders/myfolders/Teesta/data";
proc datasets library=t;
run;
Sort the data set and look at it. Note that at day 1, the percent is always 100%.
proc sort data=t.TUMOR;
by treatment mouse day;
run;
proc print data=t.TUMOR(obs=100);
var day treatment mouse pcntvol;
run;
ods graphics on;
proc sgplot data=&BL_P;
series x=day y=pcntvol/group=pcntvol_baseline;
run;
ods graphics off;
ods graphics on;
proc gee data=t.TUMOR plots=all;
class mouse trt(ref='Taxol 10') day;
model pcntvol = trt day trt*day/link=log;
repeated subject=mouse(trt) /type=exch modelse logor=fullclust;
effectplot box;
effectplot mosaic;
lsmestimate trt*day "trt*day day 2 vrs 15" [-1,1 2] [-1,2 2] [-1,3 2] [1,1 15] [1,2 15] [1,3 15],
"trt*day day 2 vrs 20" [-1,1 2] [-1,2 2] [-1,3 2] [1,1 20] [1,2 20] [1,3 20],
"trt*day day 2 vrs 28" [-1,1 2] [-1,2 2] [-1,3 2] [1,1 28] [1,2 28] [1,3 28],
"trt*day day 15 vrs 20" [-1,1 15] [-1,2 15] [-1,3 15] [1,1 20] [1,2 20] [1,3 20],
"trt*day day 15 vrs 28" [-1,1 15] [-1,2 15] [-1,3 15] [1,1 28] [1,2 28] [1,3 28],
"trt*day day 20 vrs 28" [-1,1 20] [-1,2 20] [-1,3 20] [1,1 28] [1,2 28] [1,3 28]
/E divisor=3 joint;
run;
ods graphics off;
ods graphics on;
proc gee data=t.TUMOR plots=all;
class mouse trt(ref='Taxol 10') day;
model pcntvol = trt day trt*day/;
repeated subject=mouse(trt) /type=exch modelse;
effectplot box;
effectplot mosaic;
lsmestimate trt*day "trt*day day 2 vrs 15" [-1,1 2] [-1,2 2] [-1,3 2] [1,1 15] [1,2 15] [1,3 15],
"trt*day day 2 vrs 20" [-1,1 2] [-1,2 2] [-1,3 2] [1,1 20] [1,2 20] [1,3 20],
"trt*day day 2 vrs 28" [-1,1 2] [-1,2 2] [-1,3 2] [1,1 28] [1,2 28] [1,3 28],
"trt*day day 15 vrs 20" [-1,1 15] [-1,2 15] [-1,3 15] [1,1 20] [1,2 20] [1,3 20],
"trt*day day 15 vrs 28" [-1,1 15] [-1,2 15] [-1,3 15] [1,1 28] [1,2 28] [1,3 28],
"trt*day day 20 vrs 28" [-1,1 20] [-1,2 20] [-1,3 20] [1,1 28] [1,2 28] [1,3 28]
/E divisor=3 joint;
run;
ods graphics off;
ods graphics on;
proc gee data=t.TUMOR plots=all;
class mouse trt(ref='Taxol 10') day;
model pcntvol = trt/;
repeated subject=mouse(trt) /type=exch modelse;
effectplot box;
effectplot mosaic;
run;
ods graphics off;
Parameterize using nlmixed.
proc nlmixed data=t.TUMOR;
pred = b0 + u + b1*(trt='Taxol 10') + b2*(trt='vehicle') + b3*(trt='TPA 50') + b4*(trt='TPA + Taxol');
model pcntvol ~ normal(pred,s2);
random u ~ normal(0,s2u) subject=mouse;
run;
proc nlmixed data=t.TUMOR;
parms s2u 1;
pred = b0 + u + b1*(trt='Taxol 10') + b2*(trt='vehicle') + b3*(trt='TPA 50') + b4*(trt='TPA + Taxol');
pred_log = exp(pred);
model pcntvol ~ normal(pred_log,s2);
random u ~ normal(0,s2u) subject=mouse;
run;
proc gee data=t.TUMOR plots=all;
class mouse trt(ref='Taxol 10') day;
model pcntvol = trt day trt*day;
repeated subject=mouse(trt) /type=exch within=day;
run;
proc genmod data=t.TUMOR;
class trt(ref='Taxol 10');
model pcntvol = trt day trt*day/dist = normal link=log;
run;