--- imach/src/imach.c 2003/05/16 10:44:42 1.76 +++ imach/src/imach.c 2003/05/16 16:49:47 1.77 @@ -1,4 +1,4 @@ -/* $Id: imach.c,v 1.76 2003/05/16 10:44:42 brouard Exp $ +/* $Id: imach.c,v 1.77 2003/05/16 16:49:47 brouard Exp $ Interpolated Markov Chain Short summary of the programme: @@ -1775,21 +1775,21 @@ void concatwav(int wav[], int **dh, int 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 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 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 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 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
Datafile=%s Firstpass=%d Lastpass=%d Stepm=%d Weight=%d Model=%s
\n \n Total number of observations=%d
\n -Youngest age at first pass %.2f, oldest age %.2f
\n +Youngest age at first (selected) pass %.2f, oldest age %.2f
\n Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf
\n