/* $Id$
$State$
$Log$
+ Revision 1.235 2016/08/25 06:59:23 brouard
+ *** empty log message ***
+
Revision 1.234 2016/08/23 16:51:20 brouard
*** empty log message ***
strcpy(optfileres,"vpl");
/* 1eme*/
for (cpt=1; cpt<= nlstate ; cpt ++) { /* For each live state */
- for(nres=1; nres <= nresult; nres++) /* For each resultline */
- for (k1=1; k1<= m ; k1 ++) { /* For each valid combination of covariate */
+ for (k1=1; k1<= m ; k1 ++) /* For each valid combination of covariate */
+ for(nres=1; nres <= nresult; nres++){ /* For each resultline */
/* plot [100000000000000000000:-100000000000000000000] "mysbiaspar/vplrmysbiaspar.txt to check */
if(TKresult[nres]!= k1)
continue;
/*2 eme*/
- for (k1=1; k1<= m ; k1 ++) {
+ for (k1=1; k1<= m ; k1 ++)
+ for(nres=1; nres <= nresult; nres++){ /* For each resultline */
+ if(TKresult[nres]!= k1)
+ continue;
fprintf(ficgp,"\n# 2nd: Total life expectancy with CI: 't' files ");
- for(nres=1; nres <= nresult; nres++) /* For each resultline */
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */
- if(TKresult[nres]!= k)
- continue;
lv= decodtabm(k1,k,cptcoveff); /* Should be the covariate number corresponding to k1 combination */
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */
vlv= nbcode[Tvaraff[k]][lv];
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);
- for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */
- printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
- fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
- }
+ }
+ for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */
+ printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
+ fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
}
fprintf(ficgp,"\n#\n");
if(invalidvarcomb[k1]){
/*3eme*/
- for (k1=1; k1<= m ; k1 ++) {
+ for (k1=1; k1<= m ; k1 ++)
+ for(nres=1; nres <= nresult; nres++){ /* For each resultline */
+ if(TKresult[nres]!= k)
+ continue;
for (cpt=1; cpt<= nlstate ; cpt ++) {
- fprintf(ficgp,"\n# 3d: Life expectancy with EXP_ files: cov=%d state=%d",k1, cpt);
- for(nres=1; nres <= nresult; nres++) /* For each resultline */
+ fprintf(ficgp,"\n# 3d: Life expectancy with EXP_ files: combination=%d state=%d",k1, cpt);
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */
- if(TKresult[nres]!= k)
- continue;
lv= decodtabm(k1,k,cptcoveff); /* Should be the covariate number corresponding to k1 combination */
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */
vlv= nbcode[Tvaraff[k]][lv];
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);
- for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */
- printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
- fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
- }
}
+ for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */
+ fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
+ }
fprintf(ficgp,"\n#\n");
if(invalidvarcomb[k1]){
fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1);
/* 4eme */
/* Survival functions (period) from state i in state j by initial state i */
- for (k1=1; k1<= m ; k1 ++) { /* For each multivariate if any */
+ for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */
+ for(nres=1; nres <= nresult; nres++) /* For each resultline */
+ if(TKresult[nres]!= k)
+ continue;
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state */
fprintf(ficgp,"\n#\n#\n# Survival functions in state j : 'LIJ_' files, cov=%d state=%d",k1, cpt);
- for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */
lv= decodtabm(k1,k,cptcoveff); /* Should be the covariate number corresponding to k1 combination */
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */
vlv= nbcode[Tvaraff[k]][lv];
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);
}
+ for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */
+ fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
+ }
fprintf(ficgp,"\n#\n");
if(invalidvarcomb[k1]){
fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1);
/* 5eme */
/* Survival functions (period) from state i in state j by final state j */
- for (k1=1; k1<= m ; k1 ++) { /* For each covariate if any */
+ for (k1=1; k1<= m ; k1 ++) /* For each covariate combination if any */
+ for(nres=1; nres <= nresult; nres++){ /* For each resultline */
+ if(TKresult[nres]!= k1)
+ continue;
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each inital state */
fprintf(ficgp,"\n#\n#\n# Survival functions in state j and all livestates from state i by final state j: 'lij' files, cov=%d state=%d",k1, cpt);
vlv= nbcode[Tvaraff[k]][lv];
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);
}
+ for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */
+ fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
+ }
fprintf(ficgp,"\n#\n");
if(invalidvarcomb[k1]){
fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1);
strcpy(resultsav,stra); /* and analyzes it */
}
/* Checking for missing or useless values in comparison of current model needs */
- for(k1=1; k1<= cptcovt ;k1++){ /* model line */
- if(Typevar[k1]==0){
+ for(k1=1; k1<= cptcovt ;k1++){ /* model line V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1 */
+ if(Typevar[k1]==0){ /* Single covariate in model */
match=0;
- for(k2=1; k2 <=j;k2++){
- if(Tvar[k1]==Tvarsel[k2]) {
- modelresult[k2]=k1;
+ for(k2=1; k2 <=j;k2++){/* result line V4=1 V5=24.1 V3=1 V2=8 V1=0 */
+ if(Tvar[k1]==Tvarsel[k2]) {/* Tvar[2]=5 == Tvarsel[1]=4 */
+ modelresult[k2]=k1;/* modelresult[2]=1 modelresult[1]=2 modelresult[3]=3 modelresult[6]=4 modelresult[9]=5 */
match=1;
break;
}