Diff for /imach/src/imach.c between versions 1.235 and 1.236

version 1.235, 2016/08/25 06:59:23 version 1.236, 2016/08/25 10:50:18
Line 1 Line 1
 /* $Id$  /* $Id$
   $State$    $State$
   $Log$    $Log$
     Revision 1.236  2016/08/25 10:50:18  brouard
     *** empty log message ***
   
   Revision 1.235  2016/08/25 06:59:23  brouard    Revision 1.235  2016/08/25 06:59:23  brouard
   *** empty log message ***    *** empty log message ***
   
Line 6229  void printinggnuplot(char fileresu[], ch Line 6232  void printinggnuplot(char fileresu[], ch
   strcpy(optfileres,"vpl");    strcpy(optfileres,"vpl");
   /* 1eme*/    /* 1eme*/
   for (cpt=1; cpt<= nlstate ; cpt ++) { /* For each live state */    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 */      /* plot [100000000000000000000:-100000000000000000000] "mysbiaspar/vplrmysbiaspar.txt to check */
       if(TKresult[nres]!= k1)        if(TKresult[nres]!= k1)
         continue;          continue;
Line 6314  plot [%.f:%.f] \"%s\" every :::%d::%d u Line 6317  plot [%.f:%.f] \"%s\" every :::%d::%d u
   
       
   /*2 eme*/    /*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 ");      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 */      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 */        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,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(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 */        /* decodtabm(13,3,4)= 2 because h=13 k=  1  1 (2) 2 */
       vlv= nbcode[Tvaraff[k]][lv];        vlv= nbcode[Tvaraff[k]][lv];
       fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);        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]);      for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */
         fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);        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");      fprintf(ficgp,"\n#\n");
     if(invalidvarcomb[k1]){      if(invalidvarcomb[k1]){
Line 6372  plot [%.f:%.f] \"%s\" every :::%d::%d u Line 6375  plot [%.f:%.f] \"%s\" every :::%d::%d u
                   
                   
   /*3eme*/    /*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 ++) {      for (cpt=1; cpt<= nlstate ; cpt ++) {
       fprintf(ficgp,"\n# 3d: Life expectancy with EXP_ files:  cov=%d state=%d",k1, cpt);        fprintf(ficgp,"\n# 3d: Life expectancy with EXP_ files:  combination=%d state=%d",k1, cpt);
       for(nres=1; nres <= nresult; nres++) /* For each resultline */  
       for (k=1; k<=cptcoveff; k++){    /* For each covariate and each value */        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 */          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,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(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 */          /* decodtabm(13,3,4)= 2 because h=13 k=  1  1 (2) 2 */
         vlv= nbcode[Tvaraff[k]][lv];          vlv= nbcode[Tvaraff[k]][lv];
         fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);          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");        fprintf(ficgp,"\n#\n");
       if(invalidvarcomb[k1]){        if(invalidvarcomb[k1]){
         fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1);           fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1); 
Line 6421  plot [%.f:%.f] \"%s\" every :::%d::%d u Line 6423  plot [%.f:%.f] \"%s\" every :::%d::%d u
       
   /* 4eme */    /* 4eme */
   /* Survival functions (period) from state i in state j by initial state i */    /* 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 */      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);        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 */          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,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(1,2,4) = 1 because h=1  k=  1 (1) 1  1 */
Line 6433  plot [%.f:%.f] \"%s\" every :::%d::%d u Line 6437  plot [%.f:%.f] \"%s\" every :::%d::%d u
         vlv= nbcode[Tvaraff[k]][lv];          vlv= nbcode[Tvaraff[k]][lv];
         fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);          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");        fprintf(ficgp,"\n#\n");
       if(invalidvarcomb[k1]){        if(invalidvarcomb[k1]){
         fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1);           fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1); 
Line 6463  plot [%.f:%.f]  ", ageminpar, agemaxpar) Line 6470  plot [%.f:%.f]  ", ageminpar, agemaxpar)
                   
 /* 5eme */  /* 5eme */
   /* Survival functions (period) from state i in state j by final state j */    /* 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  */      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);        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);
Line 6475  plot [%.f:%.f]  ", ageminpar, agemaxpar) Line 6485  plot [%.f:%.f]  ", ageminpar, agemaxpar)
         vlv= nbcode[Tvaraff[k]][lv];          vlv= nbcode[Tvaraff[k]][lv];
         fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv);          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");        fprintf(ficgp,"\n#\n");
       if(invalidvarcomb[k1]){        if(invalidvarcomb[k1]){
         fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1);           fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1); 
Line 8003  int decoderesult ( char resultline[], in Line 8016  int decoderesult ( char resultline[], in
       strcpy(resultsav,stra); /* and analyzes it */        strcpy(resultsav,stra); /* and analyzes it */
   }    }
   /* Checking for missing or useless values in comparison of current model needs */    /* Checking for missing or useless values in comparison of current model needs */
   for(k1=1; k1<= cptcovt ;k1++){ /* model line */    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){      if(Typevar[k1]==0){ /* Single covariate in model */
       match=0;        match=0;
       for(k2=1; k2 <=j;k2++){        for(k2=1; k2 <=j;k2++){/* result line V4=1 V5=24.1 V3=1  V2=8 V1=0 */
         if(Tvar[k1]==Tvarsel[k2]) {          if(Tvar[k1]==Tvarsel[k2]) {/* Tvar[2]=5 == Tvarsel[1]=4   */
           modelresult[k2]=k1;            modelresult[k2]=k1;/* modelresult[2]=1 modelresult[1]=2  modelresult[3]=3  modelresult[6]=4 modelresult[9]=5 */
           match=1;            match=1;
           break;            break;
         }          }

Removed from v.1.235  
changed lines
  Added in v.1.236


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>