Annotation of imach/html/doc/biaspar.gp, revision 1.7
1.5 brouard 1:
1.7 ! brouard 2: # IMaCh-0.99r24
1.5 brouard 3: # biaspar.gp
4: set datafile missing 'NaNq'
1.6 brouard 5: cd "/Users/nbrouard/Documents/imach/cvs/imach/html/doc"
1.5 brouard 6:
1.6 brouard 7: #Diagram of the model
1.5 brouard 8:
1.6 brouard 9: delta=0.03;delta2=0.07;unset arrow;
10: yoff=(2 > 2? 0:1);
1.5 brouard 11:
1.6 brouard 12: #Peripheral arrows
13: set for [i=1:2] for [j=1:2] arrow i*10+j from cos(pi*((1-(2/2)*2./2)/2+(i-1)*2./2))-(i!=j?(i-j)/abs(i-j)*delta:0), yoff +sin(pi*((1-(2/2)*2./2)/2+(i-1)*2./2)) + (i!=j?(i-j)/abs(i-j)*delta:0) rto -0.95*(cos(pi*((1-(2/2)*2./2)/2+(i-1)*2./2))+(i!=j?(i-j)/abs(i-j)*delta:0) - cos(pi*((1-(2/2)*2./2)/2+(j-1)*2./2)) + (i!=j?(i-j)/abs(i-j)*delta2:0)), -0.95*(sin(pi*((1-(2/2)*2./2)/2+(i-1)*2./2)) + (i!=j?(i-j)/abs(i-j)*delta:0) - sin(pi*((1-(2/2)*2./2)/2+(j-1)*2./2))+( i!=j?(i-j)/abs(i-j)*delta2:0)) ls (i < j? 1:2)
14:
15: #Centripete arrows (turning in other direction (1-i) instead of (i-1))
16: set for [i=1:2] arrow (2+1)*10+i from cos(pi*((1-(2/2)*2./2)/2+(1-i)*2./2))-(i!=j?(i-j)/abs(i-j)*delta:0), yoff +sin(pi*((1-(2/2)*2./2)/2+(1-i)*2./2)) + (i!=j?(i-j)/abs(i-j)*delta:0) rto -0.80*(cos(pi*((1-(2/2)*2./2)/2+(1-i)*2./2))+(i!=j?(i-j)/abs(i-j)*delta:0) ), -0.80*(sin(pi*((1-(2/2)*2./2)/2+(1-i)*2./2)) + (i!=j?(i-j)/abs(i-j)*delta:0) + yoff ) ls 4
17:
18: #show arrow
19: unset label
20:
21: #States labels, starting from 2 (2-i) instead of (1-i), was (i-1)
22: set for [i=1:2] label i sprintf("State %d",i) center at cos(pi*((1-(2/2)*2./2)/2+(2-i)*2./2)), yoff+sin(pi*((1-(2/2)*2./2)/2+(2-i)*2./2)) font "helvetica, 16" tc rgbcolor "blue"
23:
24: set label 2+1 sprintf("State %d",2+1) center at 0.,0. font "helvetica, 16" tc rgbcolor "red"
25:
26: #show label
27: unset border;unset xtics; unset ytics;
28:
29:
30: set ter svg size 640, 480;set out "biaspar/D_biaspar_.svg"
31: unset log y; plot [-1.2:1.2][yoff-1.2:1.2] 1/0 not; set out;reset;
32:
33: # Contributions to the Likelihood, mle >=1. For mle=4 no interpolation, pure matrix products.
34: #
35:
36: set log y; unset log x;set xlabel "Age"; set ylabel "Likelihood (-2Log(L))";
37: set ter pngcairo size 640, 480
38: set out "biaspar/ILK_biaspar-dest.png";
39: set log y;plot "biaspar/ILK_biaspar.txt" u 2:(-$13):6 t "All sample, transitions colored by destination" with dots lc variable; set out;
40:
41: set out "biaspar/ILK_biaspar-ori.png";
42: set log y;plot "biaspar/ILK_biaspar.txt" u 2:(-$13):5 t "All sample, transitions colored by origin" with dots lc variable; set out;
43:
44:
45: set out "biaspar/ILK_biaspar-p1j.png";set ylabel "Probability for each individual/wave";unset log;
46: # plot weighted, mean weight should have point size of 0.5
47: plot "biaspar/ILK_biaspar.txt" u 2:($5 == 1 && $6==1 ? $10 : 1/0):($12/4.):6 t "p11" with points pointtype 7 ps variable lc variable \
48: ,\
49: "" u 2:($5 == 1 && $6==2 ? $10 : 1/0):($12/4.):6 t "p12" with points pointtype 7 ps variable lc variable ,\
50: "" u 2:($5 == 1 && $6==3 ? $10 : 1/0):($12/4.):6 t "p13" with points pointtype 7 ps variable lc variable ;
51: set out; unset ylabel;
52:
53: set out "biaspar/ILK_biaspar-p2j.png";set ylabel "Probability for each individual/wave";unset log;
54: # plot weighted, mean weight should have point size of 0.5
55: plot "biaspar/ILK_biaspar.txt" u 2:($5 == 2 && $6==1 ? $10 : 1/0):($12/4.):6 t "p21" with points pointtype 7 ps variable lc variable \
56: ,\
57: "" u 2:($5 == 2 && $6==2 ? $10 : 1/0):($12/4.):6 t "p22" with points pointtype 7 ps variable lc variable ,\
58: "" u 2:($5 == 2 && $6==3 ? $10 : 1/0):($12/4.):6 t "p23" with points pointtype 7 ps variable lc variable ;
59: set out; unset ylabel;
60:
61: set out;unset log
62:
63: # 1st: Forward (stable period) prevalence with CI: 'VPL_' files and live state =1
64: #
65:
66: set out "biaspar/V_biaspar_1-1-1.svg"
67:
68: #set out "V_biaspar_1-1-1.svg"
69: set title "Alive state 1 ()" font "Helvetica,12"
1.5 brouard 70: set xlabel "Age"
71: set ylabel "Probability"
1.6 brouard 72: set ter svg size 640, 480
73: plot [70:95] "biaspar/VPL_biaspar.txt" every :::0::0 u 1:($2==1 ? $3:1/0) "%lf %lf %lf (%lf) %*lf (%*lf)" t"Forward prevalence" w l lt 0,"biaspar/VPL_biaspar.txt" every :::0::0 u 1:($2==1 ? $3+1.96*$4 : 1/0) "%lf %lf %lf (%lf) %*lf (%*lf)" t"95% CI" w l lt 1,"biaspar/VPL_biaspar.txt" every :::0::0 u 1:($2==1 ? $3-1.96*$4 : 1/0) "%lf %lf %lf (%lf) %*lf (%*lf)" t"" w l lt 1,"biaspar/P_biaspar.txt" u 1:(($2)) t 'Observed prevalence in state 1' with line lt 3
74: set out ;unset title;
75:
76: # 1st: Forward (stable period) prevalence with CI: 'VPL_' files and live state =2
77: #
1.5 brouard 78:
1.6 brouard 79: set out "biaspar/V_biaspar_2-1-1.svg"
80:
81: #set out "V_biaspar_2-1-1.svg"
82: set title "Alive state 2 ()" font "Helvetica,12"
1.5 brouard 83: set xlabel "Age"
84: set ylabel "Probability"
1.6 brouard 85: set ter svg size 640, 480
86: plot [70:95] "biaspar/VPL_biaspar.txt" every :::0::0 u 1:($2==1 ? $3:1/0) "%lf %lf %*lf (%*lf) %lf (%lf)" t"Forward prevalence" w l lt 0,"biaspar/VPL_biaspar.txt" every :::0::0 u 1:($2==1 ? $3+1.96*$4 : 1/0) "%lf %lf %*lf (%*lf) %lf (%lf)" t"95% CI" w l lt 1,"biaspar/VPL_biaspar.txt" every :::0::0 u 1:($2==1 ? $3-1.96*$4 : 1/0) "%lf %lf %*lf (%*lf) %lf (%lf)" t"" w l lt 1,"biaspar/P_biaspar.txt" u 1:(($5)) t 'Observed prevalence in state 2' with line lt 3
87: set out ;unset title;
88:
89: # 2nd: Total life expectancy with CI: 't' files
90: #
1.5 brouard 91:
1.6 brouard 92: set out "biaspar/E_biaspar_1-1.svg"
93:
94: set label "popbased 0 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
1.5 brouard 95: set ylabel "Years"
1.6 brouard 96: set ter svg size 640, 480
97: plot [70:95] "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ?$4 : 1/0) "%lf %lf %lf %lf (%lf) %*lf (%*lf) %*lf (%*lf)" t"TLE" w l lt 1, \
98: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ? $4-$5*2 : 1/0) "%lf %lf %lf %lf (%lf) %*lf (%*lf) %*lf (%*lf)" t"" w l lt 0,"biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ? $4+$5*2 : 1/0) "%lf %lf %lf %lf (%lf) %*lf (%*lf) %*lf (%*lf)" t"" w l lt 0,\
99: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ?$4 : 1/0) "%lf %lf %lf %*lf (%*lf) %lf (%lf) %*lf (%*lf)" t"LE in state (1)" w l lt 3, \
100: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ? $4-$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %lf (%lf) %*lf (%*lf)" t"" w l lt 0,"biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ? $4+$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %lf (%lf) %*lf (%*lf)" t"" w l lt 0,\
101: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ?$4 : 1/0) "%lf %lf %lf %*lf (%*lf) %*lf (%*lf) %lf (%lf)" t"LE in state (2)" w l lt 4, \
102: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ? $4-$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %*lf (%*lf) %lf (%lf)" t"" w l lt 0,"biaspar/T_biaspar.txt" every :::0::0 u 1:($2==0 && $4!=0 ? $4+$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %*lf (%*lf) %lf (%lf)" t"" w l lt 0
103: set label "popbased 1 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
104:
105: replot "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ?$4 : 1/0) "%lf %lf %lf %lf (%lf) %*lf (%*lf) %*lf (%*lf)" t"TLE" w l lt 1, \
106: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ? $4-$5*2 : 1/0) "%lf %lf %lf %lf (%lf) %*lf (%*lf) %*lf (%*lf)" t"" w l lt 0,"biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ? $4+$5*2 : 1/0) "%lf %lf %lf %lf (%lf) %*lf (%*lf) %*lf (%*lf)" t"" w l lt 0,\
107: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ?$4 : 1/0) "%lf %lf %lf %*lf (%*lf) %lf (%lf) %*lf (%*lf)" t"LE in state (1)" w l lt 3, \
108: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ? $4-$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %lf (%lf) %*lf (%*lf)" t"" w l lt 0,"biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ? $4+$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %lf (%lf) %*lf (%*lf)" t"" w l lt 0,\
109: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ?$4 : 1/0) "%lf %lf %lf %*lf (%*lf) %*lf (%*lf) %lf (%lf)" t"LE in state (2)" w l lt 4, \
110: "biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ? $4-$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %*lf (%*lf) %lf (%lf)" t"" w l lt 0,"biaspar/T_biaspar.txt" every :::0::0 u 1:($2==1 && $4!=0 ? $4+$5*2 : 1/0) "%lf %lf %lf %*lf (%*lf) %*lf (%*lf) %lf (%lf)" t"" w l lt 0
111: set out;set out "biaspar/E_biaspar_1-1.svg"; replot; set out; unset label;
112:
113:
114: # 3d: Life expectancy with EXP_ files: combination=1 state=1
115: #
116:
117: set out "biaspar/EXP_biaspar_1-1-1.svg"
118: set label "()" at graph 0.98,0.5 center rotate font "Helvetica,12"
119: set ter svg size 640, 480
120: plot [70:95] "biaspar/E_biaspar.txt" every :::0::0 u 1:2 t "e11" w l ,"biaspar/E_biaspar.txt" every :::0::0 u 1:3 t "e12" w l ,"biaspar/E_biaspar.txt" every :::0::0 u 1:4 t "e1." w l
121:
122: # 3d: Life expectancy with EXP_ files: combination=1 state=2
123: #
124:
125: set out "biaspar/EXP_biaspar_2-1-1.svg"
126: set label "()" at graph 0.98,0.5 center rotate font "Helvetica,12"
127: set ter svg size 640, 480
128: plot [70:95] "biaspar/E_biaspar.txt" every :::0::0 u 1:5 t "e21" w l ,"biaspar/E_biaspar.txt" every :::0::0 u 1:6 t "e22" w l ,"biaspar/E_biaspar.txt" every :::0::0 u 1:7 t "e2." w l
129: unset label;
130:
131: #
132: #
133: # Survival functions in state j : 'LIJ_' files, cov=1 state=1
134: #
135:
136: set out "biaspar/LIJ_biaspar_1-1-1.svg"
137: set label "Alive state 1 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
138: set xlabel "Age"
139: set ylabel "Probability to be alive"
140: set ter svg size 640, 480
141: unset log y
142: plot [70:95] "biaspar/PIJ_biaspar.txt" u ($1==1 ? ($3):1/0):($4/($4+$5+$6)) t "l(1,1)" w l, '' u ($1==1 ? ($3):1/0):($7/($7+$8+$9)) t "l(2,1)" w l
143: set out; unset label;
144:
145: #
146: #
147: # Survival functions in state j : 'LIJ_' files, cov=1 state=2
148: #
149:
150: set out "biaspar/LIJ_biaspar_2-1-1.svg"
151: set label "Alive state 2 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
152: set xlabel "Age"
153: set ylabel "Probability to be alive"
154: set ter svg size 640, 480
155: unset log y
156: plot [70:95] "biaspar/PIJ_biaspar.txt" u ($1==1 ? ($3):1/0):($5/($4+$5+$6)) t "l(1,2)" w l, '' u ($1==1 ? ($3):1/0):($8/($7+$8+$9)) t "l(2,2)" w l
157: set out; unset label;
158:
159: #
160: #
161: # Survival functions in state j and all livestates from state i by final state j: 'lij' files, cov=1 state=1
162: #
163:
164: set out "biaspar/LIJT_biaspar_1-1-1.svg"
165: set label "Alive state 1 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
166: set xlabel "Age"
167: set ylabel "Probability to be alive"
168: set ter svg size 640, 480
169: unset log y
170: plot [70:95] "biaspar/PIJ_biaspar.txt" u (($1==1 && (floor($2)%5 == 0)) ? ($3):1/0):($4) t "l(1,1)" w l, '' u (($1==1 && (floor($2)%5 == 0)) ? ($3):1/0):($5) t "l(1,2)" w l, '' u (($1==1 && (floor($2)%5 == 0)) ? ($3):1/0):($4 +$5) t"l(1,.)" w l
171: set out; unset label;
172:
173: #
174: #
175: # Survival functions in state j and all livestates from state i by final state j: 'lij' files, cov=1 state=2
1.5 brouard 176: #
1.6 brouard 177:
178: set out "biaspar/LIJT_biaspar_2-1-1.svg"
179: set label "Alive state 2 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
180: set xlabel "Age"
181: set ylabel "Probability to be alive"
182: set ter svg size 640, 480
183: unset log y
184: plot [70:95] "biaspar/PIJ_biaspar.txt" u (($1==1 && (floor($2)%5 == 0)) ? ($3):1/0):($7) t "l(2,1)" w l, '' u (($1==1 && (floor($2)%5 == 0)) ? ($3):1/0):($8) t "l(2,2)" w l, '' u (($1==1 && (floor($2)%5 == 0)) ? ($3):1/0):($7 +$8) t"l(2,.)" w l
185: set out; unset label;
186:
1.5 brouard 187: #
1.6 brouard 188: #
189: #CV preval stable (forward): 'pij' files, covariatecombination#=1 state=1
190: #
191:
192: set out "biaspar/P_biaspar_1-1-1.svg"
193: set label "Alive state 1 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
1.5 brouard 194: set xlabel "Age"
195: set ylabel "Probability"
1.6 brouard 196: set ter svg size 640, 480
1.5 brouard 197: unset log y
1.6 brouard 198: plot [70:95] "biaspar/PIJ_biaspar.txt" u ($1==1 ? ($3):1/0):($4/($4+$5)) t "prev(1,1)" w l, '' u ($1==1 ? ($3):1/0):($7/($7+$8)) t "prev(2,1)" w l
199: set out; unset label;
1.5 brouard 200:
201: #
202: #
1.6 brouard 203: #CV preval stable (forward): 'pij' files, covariatecombination#=1 state=2
204: #
205:
206: set out "biaspar/P_biaspar_2-1-1.svg"
207: set label "Alive state 2 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
1.5 brouard 208: set xlabel "Age"
209: set ylabel "Probability"
1.6 brouard 210: set ter svg size 640, 480
211: unset log y
212: plot [70:95] "biaspar/PIJ_biaspar.txt" u ($1==1 ? ($3):1/0):($5/($4+$5)) t "prev(1,2)" w l, '' u ($1==1 ? ($3):1/0):($8/($7+$8)) t "prev(2,2)" w l
213: set out; unset label;
214:
215: #
216: #
217: #Projection of prevalence to forward stable prevalence (period): 'PROJ_' files, covariatecombination#=1 state=1
218: #
219: # hpijx=probability over h years, hp.jx is weighted by observed prev
220:
221: set out "biaspar/PROJ_biaspar_1-1-1.svg"
222: set label "Alive state 1 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
223: set xlabel "Age"
224: set ylabel "Prevalence"
225: set ter svg size 640, 480
1.5 brouard 226: unset log y
1.6 brouard 227: plot [70:95] "biaspar/F_biaspar.txt" u 2:( $5/(1.-$11)):1 t 'pw.1' with line lc variable ,\
228: '' u 2:( (($1-$2) == 1919 ) ? $5/(1.-$11) : 1/0):1 with labels center not
229: set out; unset label;
230:
231: #
232: #
233: #Projection of prevalence to forward stable prevalence (period): 'PROJ_' files, covariatecombination#=1 state=2
234: #
235: # hpijx=probability over h years, hp.jx is weighted by observed prev
236:
237: set out "biaspar/PROJ_biaspar_2-1-1.svg"
238: set label "Alive state 2 ()" at graph 0.98,0.5 center rotate font "Helvetica,12"
239: set xlabel "Age"
240: set ylabel "Prevalence"
241: set ter svg size 640, 480
242: unset log y
243: plot [70:95] "biaspar/F_biaspar.txt" u 2:( $8/(1.-$11)):1 t 'pw.2' with line lc variable ,\
244: '' u 2:( (($1-$2) == 1919 ) ? $8/(1.-$11) : 1/0):1 with labels center not
245: set out; unset label;
1.5 brouard 246:
247: ##############
1.6 brouard 248: #9eme MLE estimated parameters
1.5 brouard 249: #############
250: # initial state 1
251: # current state 2
1.6 brouard 252: p1=-12.317578; p2=0.093112;
1.5 brouard 253: # current state 3
1.6 brouard 254: p3=-10.163170; p4=0.054838;
1.5 brouard 255: # initial state 2
256: # current state 1
1.6 brouard 257: p5=-1.668569; p6=-0.033906;
1.5 brouard 258: # current state 3
1.6 brouard 259: p7=-5.686920; p8=0.018135;
1.5 brouard 260: ##############
261: #
262:
263: ##############
1.6 brouard 264: #10eme Graphics of probabilities or incidences
1.5 brouard 265: #############
266: # logi(p12/p11)=a12+b12*age+c12age*age+d12*V1+e12*V1*age
267: # logi(p12/p11)=p1 +p2*age +p3*age*age+ p4*V1+ p5*V1*age
268: # logi(p13/p11)=a13+b13*age+c13age*age+d13*V1+e13*V1*age
269: # logi(p13/p11)=p6 +p7*age +p8*age*age+ p9*V1+ p10*V1*age
270: # p12+p13+p14+p11=1=p11(1+exp(a12+b12*age+c12age*age+d12*V1+e12*V1*age)
271: # +exp(a13+b13*age+c13age*age+d13*V1+e13*V1*age)+...)
272: # p11=1/(1+exp(a12+b12*age+c12age*age+d12*V1+e12*V1*age)
273: # +exp(a13+b13*age+c13age*age+d13*V1+e13*V1*age)+...)
274: # p12=exp(a12+b12*age+c12age*age+d12*V1+e12*V1*age)/
275: # (1+exp(a12+b12*age+c12age*age+d12*V1+e12*V1*age)
276: # +exp(a13+b13*age+c13age*age+d13*V1+e13*V1*age))
277: # +exp(a14+b14*age+c14age*age+d14*V1+e14*V1*age)+...)
278: #
1.6 brouard 279: #Number of graphics: first is logit, 2nd is probabilities, third is incidences per year
280: #model=
281: # Type of graphic ng=1
282: # k1=1 to 2^0=1
283:
284:
285: # Combination of dummy k1=1 which is
286: #
287:
288: set out "biaspar/PE_biaspar_1-1-1.svg"
289: set key outside
290: set title "()" font "Helvetica,12"
291:
292: set ter svg size 640, 480
293: set ylabel "Value of the logit of the model"
294:
295: unset log y
296: plot [70:95] p1+p2*x w l lw 2 lt (3*1+2)%3+1 dt 1 t "logit(p12)" , p3+p4*x w l lw 2 lt (3*1+3)%3+1 dt 1 t "logit(p13)" , p5+p6*x w l lw 2 lt (3*2+1)%3+1 dt 2 t "logit(p21)" , p7+p8*x w l lw 2 lt (3*2+3)%3+1 dt 2 t "logit(p23)"
297: set out; unset title;set key default;
298: #Number of graphics: first is logit, 2nd is probabilities, third is incidences per year
299: #model=
300: # Type of graphic ng=2
301: # k1=1 to 2^0=1
302:
303:
304: # Combination of dummy k1=1 which is
305: #
1.5 brouard 306:
1.6 brouard 307: set out "biaspar/PE_biaspar_1-2-1.svg"
308: set key outside
309: set title "()" font "Helvetica,12"
1.5 brouard 310:
1.6 brouard 311: set ter svg size 640, 480
312: set ylabel "Probability"
1.5 brouard 313:
314: set log y
1.6 brouard 315: plot [70:95] (1.)/(1+exp(p1+p2*x)+exp(p3+p4*x)) w l lw 2 lt (3*1+1)%3+1 dt 1 t "p11" , exp(p1+p2*x)/(1+exp(p1+p2*x)+exp(p3+p4*x)) w l lw 2 lt (3*1+2)%3+1 dt 1 t "p12" , exp(p3+p4*x)/(1+exp(p1+p2*x)+exp(p3+p4*x)) w l lw 2 lt (3*1+3)%3+1 dt 1 t "p13" , exp(p5+p6*x)/(1+exp(p5+p6*x)+exp(p7+p8*x)) w l lw 2 lt (3*2+1)%3+1 dt 2 t "p21" , (1.)/(1+exp(p5+p6*x)+exp(p7+p8*x)) w l lw 2 lt (3*2+2)%3+1 dt 2 t "p22" , exp(p7+p8*x)/(1+exp(p5+p6*x)+exp(p7+p8*x)) w l lw 2 lt (3*2+3)%3+1 dt 2 t "p23"
316: set out; unset title;set key default;
317: #Number of graphics: first is logit, 2nd is probabilities, third is incidences per year
318: #model=
319: # Type of graphic ng=3
320: # k1=1 to 2^0=1
321:
1.5 brouard 322:
1.6 brouard 323: # Combination of dummy k1=1 which is
324: #
1.5 brouard 325:
1.6 brouard 326: set out "biaspar/PE_biaspar_1-3-1.svg"
327: set key outside
328: set title "()" font "Helvetica,12"
329:
330: set ter svg size 640, 480
1.5 brouard 331: set ylabel "Quasi-incidence per year"
332:
333: set log y
1.6 brouard 334: plot [70:95] (1.)/(1+exp(p1+p2*x)+exp(p3+p4*x)) w l lw 2 lt (3*1+1)%3+1 dt 1 t "i11" , 12.000000*exp(p1+p2*x)/(1+exp(p1+p2*x)+exp(p3+p4*x)) w l lw 2 lt (3*1+2)%3+1 dt 1 t "i12" , 12.000000*exp(p3+p4*x)/(1+exp(p1+p2*x)+exp(p3+p4*x)) w l lw 2 lt (3*1+3)%3+1 dt 1 t "i13" , 12.000000*exp(p5+p6*x)/(1+exp(p5+p6*x)+exp(p7+p8*x)) w l lw 2 lt (3*2+1)%3+1 dt 2 t "i21" , (1.)/(1+exp(p5+p6*x)+exp(p7+p8*x)) w l lw 2 lt (3*2+2)%3+1 dt 2 t "i22" , 12.000000*exp(p7+p8*x)/(1+exp(p5+p6*x)+exp(p7+p8*x)) w l lw 2 lt (3*2+3)%3+1 dt 2 t "i23"
335: set out; unset title;set key default;
336:
1.5 brouard 337: # Routine varprob
1.6 brouard 338: # Ellipsoids of confidence
339: #
340:
1.5 brouard 341: set parametric;unset label
342: set log y;set log x; set xlabel "p13 (year-1)";set ylabel "p12 (year-1)"
1.6 brouard 343: set ter svg size 640, 480
344: set out "biaspar/VARPIJGR_biaspar_113-12.svg"
345: set label "70" at 2.140e-02, 3.617e-02 center
1.5 brouard 346: # Age 70, p13 - p12
1.6 brouard 347: plot [-pi:pi] 2.140e-02+ 2.000*( 5.514e-01* 2.264e-03*cos(t)+ 8.342e-01* 1.523e-03*sin(t)), 3.617e-02 +2.000*( -8.342e-01* 2.264e-03*cos(t)+ 5.514e-01* 1.523e-03*sin(t)) not
1.5 brouard 348: # Age 75, p13 - p12
1.6 brouard 349: set label "75" at 2.808e-02, 5.747e-02 center
350: replot 2.808e-02+ 2.000*( 3.943e-01* 2.448e-03*cos(t)+ 9.190e-01* 1.398e-03*sin(t)), 5.747e-02 +2.000*( -9.190e-01* 2.448e-03*cos(t)+ 3.943e-01* 1.398e-03*sin(t)) not
1.5 brouard 351: # Age 80, p13 - p12
1.6 brouard 352: set label "80" at 3.681e-02, 9.123e-02 center
353: replot 3.681e-02+ 2.000*( 3.741e-01* 2.676e-03*cos(t)+ 9.274e-01* 1.373e-03*sin(t)), 9.123e-02 +2.000*( -9.274e-01* 2.676e-03*cos(t)+ 3.741e-01* 1.373e-03*sin(t)) not
1.5 brouard 354: # Age 85, p13 - p12
1.6 brouard 355: set label "85" at 4.816e-02, 1.445e-01 center
356: replot 4.816e-02+ 2.000*( 3.906e-01* 4.057e-03*cos(t)+ 9.206e-01* 2.238e-03*sin(t)), 1.445e-01 +2.000*( -9.206e-01* 4.057e-03*cos(t)+ 3.906e-01* 2.238e-03*sin(t)) not
1.5 brouard 357: # Age 90, p13 - p12
1.6 brouard 358: set label "90" at 6.283e-02, 2.283e-01 center
359: replot 6.283e-02+ 2.000*( 2.754e-01* 8.795e-03*cos(t)+ 9.613e-01* 4.488e-03*sin(t)), 2.283e-01 +2.000*( -9.613e-01* 8.795e-03*cos(t)+ 2.754e-01* 4.488e-03*sin(t)) not
1.5 brouard 360: # Age 95, p13 - p12
1.6 brouard 361: set label "95" at 8.159e-02, 3.590e-01 center
362: replot 8.159e-02+ 2.000*( 1.909e-01* 1.934e-02*cos(t)+ 9.816e-01* 8.213e-03*sin(t)), 3.590e-01 +2.000*( -9.816e-01* 1.934e-02*cos(t)+ 1.909e-01* 8.213e-03*sin(t)) not
363: set out;
364: set out "biaspar/VARPIJGR_biaspar_113-12.svg";replot;set out;
365: # Ellipsoids of confidence
366: #
367:
1.5 brouard 368: set parametric;unset label
369: set log y;set log x; set xlabel "p21 (year-1)";set ylabel "p12 (year-1)"
1.6 brouard 370: set ter svg size 640, 480
371: set out "biaspar/VARPIJGR_biaspar_121-12.svg"
372: set label "70" at 2.047e-01, 3.617e-02 center
1.5 brouard 373: # Age 70, p21 - p12
1.6 brouard 374: plot [-pi:pi] 2.047e-01+ 2.000*( 9.996e-01* 2.493e-02*cos(t)+ -2.854e-02* 1.942e-03*sin(t)), 3.617e-02 +2.000*( 2.854e-02* 2.493e-02*cos(t)+ 9.996e-01* 1.942e-03*sin(t)) not
1.5 brouard 375: # Age 75, p21 - p12
1.6 brouard 376: set label "75" at 1.730e-01, 5.747e-02 center
377: replot 1.730e-01+ 2.000*( 9.986e-01* 1.494e-02*cos(t)+ -5.266e-02* 2.181e-03*sin(t)), 5.747e-02 +2.000*( 5.266e-02* 1.494e-02*cos(t)+ 9.986e-01* 2.181e-03*sin(t)) not
1.5 brouard 378: # Age 80, p21 - p12
1.6 brouard 379: set label "80" at 1.462e-01, 9.123e-02 center
380: replot 1.462e-01+ 2.000*( 9.951e-01* 8.486e-03*cos(t)+ -9.892e-02* 2.403e-03*sin(t)), 9.123e-02 +2.000*( 9.892e-02* 8.486e-03*cos(t)+ 9.951e-01* 2.403e-03*sin(t)) not
1.5 brouard 381: # Age 85, p21 - p12
1.6 brouard 382: set label "85" at 1.235e-01, 1.445e-01 center
383: replot 1.235e-01+ 2.000*( 9.684e-01* 6.423e-03*cos(t)+ -2.493e-01* 3.599e-03*sin(t)), 1.445e-01 +2.000*( 2.493e-01* 6.423e-03*cos(t)+ 9.684e-01* 3.599e-03*sin(t)) not
1.5 brouard 384: # Age 90, p21 - p12
1.6 brouard 385: set label "90" at 1.042e-01, 2.283e-01 center
386: replot 1.042e-01+ 2.000*( 5.573e-01* 9.289e-03*cos(t)+ -8.303e-01* 6.600e-03*sin(t)), 2.283e-01 +2.000*( 8.303e-01* 9.289e-03*cos(t)+ 5.573e-01* 6.600e-03*sin(t)) not
1.5 brouard 387: # Age 95, p21 - p12
1.6 brouard 388: set label "95" at 8.796e-02, 3.590e-01 center
389: replot 8.796e-02+ 2.000*( 1.959e-01* 1.934e-02*cos(t)+ -9.806e-01* 8.711e-03*sin(t)), 3.590e-01 +2.000*( 9.806e-01* 1.934e-02*cos(t)+ 1.959e-01* 8.711e-03*sin(t)) not
390: set out;
391: set out "biaspar/VARPIJGR_biaspar_121-12.svg";replot;set out;
392: # Ellipsoids of confidence
393: #
394:
1.5 brouard 395: set parametric;unset label
396: set log y;set log x; set xlabel "p23 (year-1)";set ylabel "p12 (year-1)"
1.6 brouard 397: set ter svg size 640, 480
398: set out "biaspar/VARPIJGR_biaspar_123-12.svg"
399: set label "70" at 1.406e-01, 3.617e-02 center
1.5 brouard 400: # Age 70, p23 - p12
1.6 brouard 401: plot [-pi:pi] 1.406e-01+ 2.000*( 9.987e-01* 1.493e-02*cos(t)+ -5.178e-02* 1.920e-03*sin(t)), 3.617e-02 +2.000*( 5.178e-02* 1.493e-02*cos(t)+ 9.987e-01* 1.920e-03*sin(t)) not
1.5 brouard 402: # Age 75, p23 - p12
1.6 brouard 403: set label "75" at 1.542e-01, 5.747e-02 center
404: replot 1.542e-01+ 2.000*( 9.970e-01* 1.241e-02*cos(t)+ -7.775e-02* 2.112e-03*sin(t)), 5.747e-02 +2.000*( 7.775e-02* 1.241e-02*cos(t)+ 9.970e-01* 2.112e-03*sin(t)) not
1.5 brouard 405: # Age 80, p23 - p12
1.6 brouard 406: set label "80" at 1.690e-01, 9.123e-02 center
407: replot 1.690e-01+ 2.000*( 9.927e-01* 9.663e-03*cos(t)+ -1.210e-01* 2.265e-03*sin(t)), 9.123e-02 +2.000*( 1.210e-01* 9.663e-03*cos(t)+ 9.927e-01* 2.265e-03*sin(t)) not
1.5 brouard 408: # Age 85, p23 - p12
1.6 brouard 409: set label "85" at 1.851e-01, 1.445e-01 center
410: replot 1.851e-01+ 2.000*( 9.733e-01* 7.552e-03*cos(t)+ -2.295e-01* 3.515e-03*sin(t)), 1.445e-01 +2.000*( 2.295e-01* 7.552e-03*cos(t)+ 9.733e-01* 3.515e-03*sin(t)) not
1.5 brouard 411: # Age 90, p23 - p12
1.6 brouard 412: set label "90" at 2.028e-01, 2.283e-01 center
413: replot 2.028e-01+ 2.000*( 6.011e-01* 9.259e-03*cos(t)+ -7.992e-01* 7.110e-03*sin(t)), 2.283e-01 +2.000*( 7.992e-01* 9.259e-03*cos(t)+ 6.011e-01* 7.110e-03*sin(t)) not
1.5 brouard 414: # Age 95, p23 - p12
1.6 brouard 415: set label "95" at 2.219e-01, 3.590e-01 center
416: replot 2.219e-01+ 2.000*( 2.273e-01* 1.937e-02*cos(t)+ -9.738e-01* 1.173e-02*sin(t)), 3.590e-01 +2.000*( 9.738e-01* 1.937e-02*cos(t)+ 2.273e-01* 1.173e-02*sin(t)) not
417: set out;
418: set out "biaspar/VARPIJGR_biaspar_123-12.svg";replot;set out;
419: # Ellipsoids of confidence
420: #
421:
1.5 brouard 422: set parametric;unset label
423: set log y;set log x; set xlabel "p21 (year-1)";set ylabel "p13 (year-1)"
1.6 brouard 424: set ter svg size 640, 480
425: set out "biaspar/VARPIJGR_biaspar_121-13.svg"
426: set label "70" at 2.047e-01, 2.140e-02 center
1.5 brouard 427: # Age 70, p21 - p13
1.6 brouard 428: plot [-pi:pi] 2.047e-01+ 2.000*( 1.000e+00* 2.492e-02*cos(t)+ -2.081e-03* 1.781e-03*sin(t)), 2.140e-02 +2.000*( 2.081e-03* 2.492e-02*cos(t)+ 1.000e+00* 1.781e-03*sin(t)) not
1.5 brouard 429: # Age 75, p21 - p13
1.6 brouard 430: set label "75" at 1.730e-01, 2.808e-02 center
431: replot 1.730e-01+ 2.000*( 1.000e+00* 1.492e-02*cos(t)+ -2.295e-03* 1.606e-03*sin(t)), 2.808e-02 +2.000*( 2.295e-03* 1.492e-02*cos(t)+ 1.000e+00* 1.606e-03*sin(t)) not
1.5 brouard 432: # Age 80, p21 - p13
1.6 brouard 433: set label "80" at 1.462e-01, 3.681e-02 center
434: replot 1.462e-01+ 2.000*( 1.000e+00* 8.448e-03*cos(t)+ -5.527e-03* 1.619e-03*sin(t)), 3.681e-02 +2.000*( 5.527e-03* 8.448e-03*cos(t)+ 1.000e+00* 1.619e-03*sin(t)) not
1.5 brouard 435: # Age 85, p21 - p13
1.6 brouard 436: set label "85" at 1.235e-01, 4.816e-02 center
437: replot 1.235e-01+ 2.000*( 9.994e-01* 6.288e-03*cos(t)+ -3.508e-02* 2.591e-03*sin(t)), 4.816e-02 +2.000*( 3.508e-02* 6.288e-03*cos(t)+ 9.994e-01* 2.591e-03*sin(t)) not
1.5 brouard 438: # Age 90, p21 - p13
1.6 brouard 439: set label "90" at 1.042e-01, 6.283e-02 center
440: replot 1.042e-01+ 2.000*( 9.956e-01* 7.558e-03*cos(t)+ -9.337e-02* 4.919e-03*sin(t)), 6.283e-02 +2.000*( 9.337e-02* 7.558e-03*cos(t)+ 9.956e-01* 4.919e-03*sin(t)) not
1.5 brouard 441: # Age 95, p21 - p13
1.6 brouard 442: set label "95" at 8.796e-02, 8.159e-02 center
443: replot 8.796e-02+ 2.000*( 8.858e-01* 9.520e-03*cos(t)+ -4.641e-01* 8.679e-03*sin(t)), 8.159e-02 +2.000*( 4.641e-01* 9.520e-03*cos(t)+ 8.858e-01* 8.679e-03*sin(t)) not
444: set out;
445: set out "biaspar/VARPIJGR_biaspar_121-13.svg";replot;set out;
446: # Ellipsoids of confidence
447: #
448:
1.5 brouard 449: set parametric;unset label
450: set log y;set log x; set xlabel "p23 (year-1)";set ylabel "p13 (year-1)"
1.6 brouard 451: set ter svg size 640, 480
452: set out "biaspar/VARPIJGR_biaspar_123-13.svg"
453: set label "70" at 1.406e-01, 2.140e-02 center
1.5 brouard 454: # Age 70, p23 - p13
1.6 brouard 455: plot [-pi:pi] 1.406e-01+ 2.000*( 9.985e-01* 1.494e-02*cos(t)+ 5.556e-02* 1.579e-03*sin(t)), 2.140e-02 +2.000*( -5.556e-02* 1.494e-02*cos(t)+ 9.985e-01* 1.579e-03*sin(t)) not
1.5 brouard 456: # Age 75, p23 - p13
1.6 brouard 457: set label "75" at 1.542e-01, 2.808e-02 center
458: replot 1.542e-01+ 2.000*( 9.976e-01* 1.240e-02*cos(t)+ 6.965e-02* 1.358e-03*sin(t)), 2.808e-02 +2.000*( -6.965e-02* 1.240e-02*cos(t)+ 9.976e-01* 1.358e-03*sin(t)) not
1.5 brouard 459: # Age 80, p23 - p13
1.6 brouard 460: set label "80" at 1.690e-01, 3.681e-02 center
461: replot 1.690e-01+ 2.000*( 9.951e-01* 9.643e-03*cos(t)+ 9.913e-02* 1.314e-03*sin(t)), 3.681e-02 +2.000*( -9.913e-02* 9.643e-03*cos(t)+ 9.951e-01* 1.314e-03*sin(t)) not
1.5 brouard 462: # Age 85, p23 - p13
1.6 brouard 463: set label "85" at 1.851e-01, 4.816e-02 center
464: replot 1.851e-01+ 2.000*( 9.815e-01* 7.522e-03*cos(t)+ 1.914e-01* 2.205e-03*sin(t)), 4.816e-02 +2.000*( -1.914e-01* 7.522e-03*cos(t)+ 9.815e-01* 2.205e-03*sin(t)) not
1.5 brouard 465: # Age 90, p23 - p13
1.6 brouard 466: set label "90" at 2.028e-01, 6.283e-02 center
467: replot 2.028e-01+ 2.000*( 9.340e-01* 8.361e-03*cos(t)+ 3.573e-01* 4.223e-03*sin(t)), 6.283e-02 +2.000*( -3.573e-01* 8.361e-03*cos(t)+ 9.340e-01* 4.223e-03*sin(t)) not
1.5 brouard 468: # Age 95, p23 - p13
1.6 brouard 469: set label "95" at 2.219e-01, 8.159e-02 center
470: replot 2.219e-01+ 2.000*( 9.094e-01* 1.298e-02*cos(t)+ 4.159e-01* 7.733e-03*sin(t)), 8.159e-02 +2.000*( -4.159e-01* 1.298e-02*cos(t)+ 9.094e-01* 7.733e-03*sin(t)) not
471: set out;
472: set out "biaspar/VARPIJGR_biaspar_123-13.svg";replot;set out;
473: # Ellipsoids of confidence
474: #
475:
1.5 brouard 476: set parametric;unset label
477: set log y;set log x; set xlabel "p23 (year-1)";set ylabel "p21 (year-1)"
1.6 brouard 478: set ter svg size 640, 480
479: set out "biaspar/VARPIJGR_biaspar_123-21.svg"
480: set label "70" at 1.406e-01, 2.047e-01 center
1.5 brouard 481: # Age 70, p23 - p21
1.6 brouard 482: plot [-pi:pi] 1.406e-01+ 2.000*( 3.099e-02* 2.492e-02*cos(t)+ 9.995e-01* 1.490e-02*sin(t)), 2.047e-01 +2.000*( -9.995e-01* 2.492e-02*cos(t)+ 3.099e-02* 1.490e-02*sin(t)) not
1.5 brouard 483: # Age 75, p23 - p21
1.6 brouard 484: set label "75" at 1.542e-01, 1.730e-01 center
485: replot 1.542e-01+ 2.000*( 8.468e-02* 1.494e-02*cos(t)+ 9.964e-01* 1.235e-02*sin(t)), 1.730e-01 +2.000*( -9.964e-01* 1.494e-02*cos(t)+ 8.468e-02* 1.235e-02*sin(t)) not
1.5 brouard 486: # Age 80, p23 - p21
1.6 brouard 487: set label "80" at 1.690e-01, 1.462e-01 center
488: replot 1.690e-01+ 2.000*( 9.896e-01* 9.619e-03*cos(t)+ 1.436e-01* 8.421e-03*sin(t)), 1.462e-01 +2.000*( -1.436e-01* 9.619e-03*cos(t)+ 9.896e-01* 8.421e-03*sin(t)) not
1.5 brouard 489: # Age 85, p23 - p21
1.6 brouard 490: set label "85" at 1.851e-01, 1.235e-01 center
491: replot 1.851e-01+ 2.000*( 9.870e-01* 7.423e-03*cos(t)+ 1.606e-01* 6.252e-03*sin(t)), 1.235e-01 +2.000*( -1.606e-01* 7.423e-03*cos(t)+ 9.870e-01* 6.252e-03*sin(t)) not
1.5 brouard 492: # Age 90, p23 - p21
1.6 brouard 493: set label "90" at 2.028e-01, 1.042e-01 center
494: replot 2.028e-01+ 2.000*( 9.136e-01* 8.053e-03*cos(t)+ 4.065e-01* 7.432e-03*sin(t)), 1.042e-01 +2.000*( -4.065e-01* 8.053e-03*cos(t)+ 9.136e-01* 7.432e-03*sin(t)) not
1.5 brouard 495: # Age 95, p23 - p21
1.6 brouard 496: set label "95" at 2.219e-01, 8.796e-02 center
497: replot 2.219e-01+ 2.000*( 9.960e-01* 1.226e-02*cos(t)+ 8.959e-02* 9.318e-03*sin(t)), 8.796e-02 +2.000*( -8.959e-02* 1.226e-02*cos(t)+ 9.960e-01* 9.318e-03*sin(t)) not
498: set out;
499: set out "biaspar/VARPIJGR_biaspar_123-21.svg";replot;set out;
500: # Routine varevsij
501: unset title
502:
503: unset parametric;unset label; set ter svg size 640, 480
504: set log y; unset log x;set xlabel "Age"; set ylabel "Force of mortality (year-1)";
505: set out "biaspar/VARMUPTJGR--STABLBASED_biaspar1.svg";
506: plot "biaspar/PRMORPREV-1-STABLBASED_biaspar.txt" u 1:($3) not w l lt 1
507: replot "biaspar/PRMORPREV-1-STABLBASED_biaspar.txt" u 1:(($3+1.96*$4)) t "95% interval" w l lt 2
508: replot "biaspar/PRMORPREV-1-STABLBASED_biaspar.txt" u 1:(($3-1.96*$4)) not w l lt 2
509: set out;
510: set out "biaspar/VARMUPTJGR--STABLBASED_biaspar1.svg";replot;set out;
511:
1.5 brouard 512: # Routine varevsij
1.6 brouard 513: unset title
514:
515: unset parametric;unset label; set ter svg size 640, 480
1.5 brouard 516: set log y; unset log x;set xlabel "Age"; set ylabel "Force of mortality (year-1)";
1.6 brouard 517: set out "biaspar/VARMUPTJGR--POPULBASED-NOMOBIL_biaspar1.svg";
518: plot "biaspar/PRMORPREV-1-POPULBASED-NOMOBIL_biaspar.txt" u 1:($3) not w l lt 1
519: replot "biaspar/PRMORPREV-1-POPULBASED-NOMOBIL_biaspar.txt" u 1:(($3+1.96*$4)) t "95% interval" w l lt 2
520: replot "biaspar/PRMORPREV-1-POPULBASED-NOMOBIL_biaspar.txt" u 1:(($3-1.96*$4)) not w l lt 2
521: set out;
522: set out "biaspar/VARMUPTJGR--POPULBASED-NOMOBIL_biaspar1.svg";replot;set out;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>