--- imach/src/imach.c 2017/04/03 10:17:47 1.258 +++ imach/src/imach.c 2017/04/04 13:01:16 1.259 @@ -1,6 +1,9 @@ -/* $Id: imach.c,v 1.258 2017/04/03 10:17:47 brouard Exp $ +/* $Id: imach.c,v 1.259 2017/04/04 13:01:16 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.259 2017/04/04 13:01:16 brouard + Summary: Some errors to warnings only if date of death is unknown but status is death we could set to pi3 + Revision 1.258 2017/04/03 10:17:47 brouard Summary: Version 0.99r12 @@ -976,12 +979,12 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.258 2017/04/03 10:17:47 brouard Exp $ */ +/* $Id: imach.c,v 1.259 2017/04/04 13:01:16 brouard Exp $ */ /* $State: Exp $ */ #include "version.h" char version[]=__IMACH_VERSION__; char copyright[]="February 2016,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015-2018"; -char fullversion[]="$Revision: 1.258 $ $Date: 2017/04/03 10:17:47 $"; +char fullversion[]="$Revision: 1.259 $ $Date: 2017/04/04 13:01:16 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -6455,7 +6458,7 @@ void printinghtml(char fileresu[], char } } /* aij, bij */ - fprintf(fichtm,"
- Logit model (yours is: 1+age+%s), for example: logit(pij)=log(pij/pii)= aij+ bij age + V1 age + etc. as a function of age: %s_%d-1-%d.svg
\ + fprintf(fichtm,"
- Logit model (yours is: logit(pij)=log(pij/pii)= aij+ bij age+%s) as a function of age: %s_%d-1-%d.svg
\ ",model,subdirf2(optionfilefiname,"PE_"),k1,nres,subdirf2(optionfilefiname,"PE_"),k1,nres,subdirf2(optionfilefiname,"PE_"),k1,nres); /* Pij */ fprintf(fichtm,"
\n- Pij or conditional probabilities to be observed in state j being in state i, %d (stepm) months before: %s_%d-2-%d.svg
\ @@ -9105,19 +9108,19 @@ int calandcheckages(int imx, int maxwav, s[m][i]=-1; } if((int)moisdc[i]==99 && (int)andc[i]==9999 && s[m][i]>nlstate){ - *nberr = *nberr + 1; + *nbwarn = *nbwarn + 1; if(firstone == 0){ firstone=1; - printf("Error! Date of death (month %2d and year %4d) of individual %ld on line %d was unknown, you must set an arbitrary year of death or he/she is skipped and results can be biased (%d) because status is a death state %d at wave %d. Wave dropped.\nOther similar cases in log file\n",(int)moisdc[i],(int)andc[i],num[i],i, *nberr,s[m][i],m); + printf("Warning (#%d)! Date of death (month %2d and year %4d) of individual %ld on line %d was unknown but status is a death state %d at wave %d. If you don't know the vital status, please enter -2. If he/she is still alive but don't know the state, please code with '-1 or '.'. Here, we believe in a death.\nOther similar cases in log file\n", *nbwarn,(int)moisdc[i],(int)andc[i],num[i],i,s[m][i],m); } - fprintf(ficlog,"Error! Date of death (month %2d and year %4d) of individual %ld on line %d was unknown, you must set an arbitrary year of death or he/she is skipped and results can be biased (%d) because status is a death state %d at wave %d. Wave dropped.\n",(int)moisdc[i],(int)andc[i],num[i],i, *nberr,s[m][i],m); - s[m][i]=-1; + fprintf(ficlog,"Warning (#%d)! Date of death (month %2d and year %4d) of individual %ld on line %d was unknown but status is a death state %d at wave %d. If you don't know the vital status, please enter -2. If he/she is still alive but don't know the state, please code with '-1 or '.'. Here, we believe in a death.\nOther similar cases in log file\n", *nbwarn,(int)moisdc[i],(int)andc[i],num[i],i,s[m][i],m); + /* s[m][i]=-1; */ /* Keeping the death status */ } if((int)moisdc[i]==99 && (int)andc[i]!=9999 && s[m][i]>nlstate){ (*nberr)++; - printf("Error! Month of death of individual %ld 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 %ld 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; /* We prefer to skip it (and to skip it in version 0.8a1 too */ + printf("Error (#%d)! Month of death of individual %ld on line %d was unknown (%2d) (year of death is %4d) and status is a death state %d at wave %d. Please impute an arbitrary (or not) month and rerun. Currently this transition to death will be skipped (status is set to -2).\nOther similar cases in log file\n", *nberr, num[i],i,(int)moisdc[i],(int)andc[i],s[m][i],m); + fprintf(ficlog,"Error (#%d)! Month of death of individual %ld on line %d was unknown (%2d) (year of death is %4d) and status is a death state %d at wave %d. Please impute an arbitrary (or not) month and rerun. Currently this transition to death will be skipped (status is set to -2).\nOther similar cases in log file\n", *nberr, num[i],i,(int)moisdc[i],(int)andc[i],s[m][i],m); + s[m][i]=-2; /* We prefer to skip it (and to skip it in version 0.8a1 too */ } } } @@ -11268,10 +11271,11 @@ Please run with mle=-1 to get a correct fprintf(ficlog,"result: %s\n",resultline); break; case 14: - if(ncovmodel >2){ - printf("ERROR: no result line! It should be at minimum 'result: V2=0 V1=1 or result:.' %s\n",line); + if(ncovmodel >2 && nresult==0 ){ + printf("ERROR: no result lines! It should be at minimum 'result: V2=0 V1=1 or result:.' %s\n",line); goto end; } + break; default: nresult=1; decoderesult(".",nresult ); /* No covariate */