]> henry.ined.fr Git - .git/commitdiff
(Module): Insert of a warning if the delay between two waves is
authorN. Brouard <brouard@ined.fr>
Fri, 16 May 2003 16:49:47 +0000 (16:49 +0000)
committerN. Brouard <brouard@ined.fr>
Fri, 16 May 2003 16:49:47 +0000 (16:49 +0000)
negative.

src/imach.c

index 7cf6dd05173d4fe5417da177c0b9b8678b7c65f1..3b1abd6eafd7afdf375cc2d935533f0ab260f2bf 100644 (file)
@@ -1775,21 +1775,21 @@ void  concatwav(int wav[], int **dh, int **bh,  int **mw, int **s, double *agedc
     wav[i]=mi;
     if(mi==0){
       if(first==0){
-       printf("Warning, no any valid information for:%d line=%d and may be others, see log file\n",num[i],i);
+       printf("Warning! None valid information for:%d line=%d (skipped) and may be others, see log file\n",num[i],i);
        first=1;
       }
       if(first==1){
-       fprintf(ficlog,"Warning, no any valid information for:%d line=%d\n",num[i],i);
+       fprintf(ficlog,"Warning! None valid information for:%d line=%d (skipped)\n",num[i],i);
       }
     } /* end mi==0 */
-  }
+  } /* End individuals */
 
   for(i=1; i<=imx; i++){
     for(mi=1; mi<wav[i];mi++){
       if (stepm <=0)
        dh[mi][i]=1;
       else{
-       if (s[mw[mi+1][i]][i] > nlstate) {
+       if (s[mw[mi+1][i]][i] > nlstate) { /* A death */
          if (agedc[i] < 2*AGESUP) {
          j= rint(agedc[i]*12-agev[mw[mi][i]][i]*12); 
          if(j==0) j=1;  /* Survives at least one month after exam */
@@ -1797,9 +1797,9 @@ void  concatwav(int wav[], int **dh, int **bh,  int **mw, int **s, double *agedc
          if (j >= jmax) jmax=j;
          if (j <= jmin) jmin=j;
          sum=sum+j;
-         /*if (j<0) printf("j=%d num=%d \n",j,i); */
+         /*if (j<0) printf("j=%d num=%d \n",j,i);*/
          /*      printf("%d %d %d %d\n", s[mw[mi][i]][i] ,s[mw[mi+1][i]][i],j,i);*/
-         /*printf("%d %lf %d %d %d\n", i,agev[mw[mi][i]][i],j,s[mw[mi][i]][i] ,s[mw[mi+1][i]][i]);*/
+         if(j<0)printf("Warning! Negative delay (%d) between waves %d and %d of individual at line %d who is aged %.1f with statuses %d %d\n ",j,mw[mi][i],mw[mi+1][i], i,agev[mw[mi][i]][i],s[mw[mi][i]][i] ,s[mw[mi+1][i]][i]);
          }
        }
        else{
@@ -1810,6 +1810,7 @@ void  concatwav(int wav[], int **dh, int **bh,  int **mw, int **s, double *agedc
          else if (j <= jmin)jmin=j;
          /*        if (j<10) printf("j=%d jmin=%d num=%d ",j,jmin,i); */
          /*printf("%d %lf %d %d %d\n", i,agev[mw[mi][i]][i],j,s[mw[mi][i]][i] ,s[mw[mi+1][i]][i]);*/
+         if(j<0)printf("Warning! Negative delay (%d to death) between waves %d and %d of individual at line %d who is aged %.1f with statuses %d %d\n ",j,mw[mi][i],mw[mi+1][i], i,agev[mw[mi][i]][i],s[mw[mi][i]][i] ,s[mw[mi+1][i]][i]);
          sum=sum+j;
        }
        jk= j/stepm;
@@ -2011,6 +2012,7 @@ void evsij(char fileres[], double ***eij, double x[], int nlstate, int stepm, in
        for(i=1;i<=nlstate;i++){
          cptj=cptj+1;
          for(h=0, gm[h][cptj]=0.; h<=nhstepm-1; h++){
+
            gm[h][cptj] = (p3mat[i][j][h]+p3mat[i][j][h+1])/2.;
          }
        }
@@ -3823,14 +3825,13 @@ int main(int argc, char *argv[])
        s[m][i]=-1;
       }
       if((int)moisdc[i]==99 && (int)andc[i]==9999 && s[m][i]>nlstate){
-       printf("Error! Date of death (month %2d and year %4d) of individual %d on line %d was unknown %d, set an arbitrary year of death\n",(int)moisdc[i],(int)andc[i],num[i],i);
-       fprintf(ficlog,"Error! Date of death (month %2d and year %4d) of individual %d on line %d was unknown %d, set an arbitrary year of death\n",(int)moisdc[i],(int)andc[i],num[i],i);
+       printf("Error! Date of death (month %2d and year %4d) of individual %d on line %d was unknown, you must set an arbitrary year of death or he/she is skipped and results are biased\n",(int)moisdc[i],(int)andc[i],num[i],i);
+       fprintf(ficlog,"Error! Date of death (month %2d and year %4d) of individual %d on line %d was unknown, you must set an arbitrary year of death or he/she is skipped and results are biased\n",(int)moisdc[i],(int)andc[i],num[i],i);
        s[m][i]=-1;
       }
       if((int)moisdc[i]==99 && (int)andc[i]!=9999 && s[m][i]>nlstate){
-       printf("Warning! Month of death of individual %d on line %d was unknown %2d, we set it to June\n",num[i],i,(int)moisdc[i]); 
-       fprintf(ficlog,"Warning! Month of death of individual %d on line %d was unknown %f, we set it to June\n",num[i],i,moisdc[i]); 
-       moisdc[i]=6;
+       printf("Error! Month of death of individual %d on line %d was unknown %2d, you should set it otherwise the information on the death is skipped and results are biased.\n",num[i],i,(int)moisdc[i]); 
+       fprintf(ficlog,"Error! Month of death of individual %d on line %d was unknown %f, you should set it otherwise the information on the death is skipped and results are biased.\n",num[i],i,moisdc[i]); 
        s[m][i]=-1;
       }
     }
@@ -4155,7 +4156,7 @@ int main(int argc, char *argv[])
 Title=%s <br>Datafile=%s Firstpass=%d Lastpass=%d Stepm=%d Weight=%d Model=%s<br>\n
 \n
 Total number of observations=%d <br>\n
-Youngest age at first pass %.2f, oldest age %.2f<br>\n
+Youngest age at first (selected) pass %.2f, oldest age %.2f<br>\n
 Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf<br>\n
 <hr  size=\"2\" color=\"#EC5E5E\">
  <ul><li><h4>Parameter files</h4>\n