version 1.258, 2017/04/03 10:17:47
|
version 1.260, 2017/04/04 17:46:59
|
Line 1
|
Line 1
|
/* $Id$ |
/* $Id$ |
$State$ |
$State$ |
$Log$ |
$Log$ |
|
Revision 1.260 2017/04/04 17:46:59 brouard |
|
Summary: Gnuplot indexations fixed (humm) |
|
|
|
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 |
Revision 1.258 2017/04/03 10:17:47 brouard |
Summary: Version 0.99r12 |
Summary: Version 0.99r12 |
|
|
Line 4656 Title=%s <br>Datafile=%s Firstpass=%d La
|
Line 4662 Title=%s <br>Datafile=%s Firstpass=%d La
|
if(posproptt < 1.e-5){ |
if(posproptt < 1.e-5){ |
fprintf(ficresphtm,"\n <p><b> This combination (%d) is not valid and no result will be produced</b></p>",j1); |
fprintf(ficresphtm,"\n <p><b> This combination (%d) is not valid and no result will be produced</b></p>",j1); |
fprintf(ficresphtmfr,"\n <p><b> This combination (%d) is not valid and no result will be produced</b></p>",j1); |
fprintf(ficresphtmfr,"\n <p><b> This combination (%d) is not valid and no result will be produced</b></p>",j1); |
fprintf(ficres,"\n This combination (%d) is not valid and no result will be produced\n\n",j1); |
fprintf(ficlog,"# This combination (%d) is not valid and no result will be produced\n",j1); |
|
printf("# This combination (%d) is not valid and no result will be produced\n",j1); |
invalidvarcomb[j1]=1; |
invalidvarcomb[j1]=1; |
}else{ |
}else{ |
fprintf(ficresphtm,"\n <p> This combination (%d) is valid and result will be produced.</p>",j1); |
fprintf(ficresphtm,"\n <p> This combination (%d) is valid and result will be produced.</p>",j1); |
Line 5019 void concatwav(int wav[], int **dh, int
|
Line 5026 void concatwav(int wav[], int **dh, int
|
if (stepm <=0) |
if (stepm <=0) |
dh[mi][i]=1; |
dh[mi][i]=1; |
else{ |
else{ |
if (s[mw[mi+1][i]][i] > nlstate) { /* A death */ |
if (s[mw[mi+1][i]][i] > nlstate) { /* A death, but what if date is unknown? */ |
if (agedc[i] < 2*AGESUP) { |
if (agedc[i] < 2*AGESUP) { |
j= rint(agedc[i]*12-agev[mw[mi][i]][i]*12); |
j= rint(agedc[i]*12-agev[mw[mi][i]][i]*12); |
if(j==0) j=1; /* Survives at least one month after exam */ |
if(j==0) j=1; /* Survives at least one month after exam */ |
Line 6455 void printinghtml(char fileresu[], char
|
Line 6462 void printinghtml(char fileresu[], char
|
} |
} |
} |
} |
/* aij, bij */ |
/* aij, bij */ |
fprintf(fichtm,"<br>- 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: <a href=\"%s_%d-1-%d.svg\">%s_%d-1-%d.svg</a><br> \ |
fprintf(fichtm,"<br>- Logit model (yours is: logit(pij)=log(pij/pii)= aij+ bij age+%s) as a function of age: <a href=\"%s_%d-1-%d.svg\">%s_%d-1-%d.svg</a><br> \ |
<img src=\"%s_%d-1-%d.svg\">",model,subdirf2(optionfilefiname,"PE_"),k1,nres,subdirf2(optionfilefiname,"PE_"),k1,nres,subdirf2(optionfilefiname,"PE_"),k1,nres); |
<img src=\"%s_%d-1-%d.svg\">",model,subdirf2(optionfilefiname,"PE_"),k1,nres,subdirf2(optionfilefiname,"PE_"),k1,nres,subdirf2(optionfilefiname,"PE_"),k1,nres); |
/* Pij */ |
/* Pij */ |
fprintf(fichtm,"<br>\n- P<sub>ij</sub> or conditional probabilities to be observed in state j being in state i, %d (stepm) months before: <a href=\"%s_%d-2-%d.svg\">%s_%d-2-%d.svg</a><br> \ |
fprintf(fichtm,"<br>\n- P<sub>ij</sub> or conditional probabilities to be observed in state j being in state i, %d (stepm) months before: <a href=\"%s_%d-2-%d.svg\">%s_%d-2-%d.svg</a><br> \ |
Line 6678 void printinggnuplot(char fileresu[], ch
|
Line 6685 void printinggnuplot(char fileresu[], ch
|
/* printf("\n#\n"); */ |
/* printf("\n#\n"); */ |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
if(invalidvarcomb[k1]){ |
if(invalidvarcomb[k1]){ |
|
/*k1=k1-1;*/ /* To be checked */ |
fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1); |
fprintf(ficgp,"#Combination (%d) ignored because no cases \n",k1); |
continue; |
continue; |
} |
} |
|
|
fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" \n",subdirf2(optionfilefiname,"V_"),cpt,k1,nres); |
fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" \n",subdirf2(optionfilefiname,"V_"),cpt,k1,nres); |
fprintf(ficgp,"\n#set out \"V_%s_%d-%d-%d.svg\" \n",optionfilefiname,cpt,k1,nres); |
fprintf(ficgp,"\n#set out \"V_%s_%d-%d-%d.svg\" \n",optionfilefiname,cpt,k1,nres); |
fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \nset ter svg size 640, 480\nplot [%.f:%.f] \"%s\" every :::%d::%d u 1:($2==%d ? $3:1/0) \"%%lf %%lf",ageminpar,fage,subdirf2(fileresu,"VPL_"),k1-1,k1-1,nres); |
fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \nset ter svg size 640, 480\nplot [%.f:%.f] \"%s\" every :::%d::%d u 1:($2==%d ? $3:1/0) \"%%lf %%lf",ageminpar,fage,subdirf2(fileresu,"VPL_"),nres-1,nres-1,nres); |
|
/* fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \nset ter svg size 640, 480\nplot [%.f:%.f] \"%s\" every :::%d::%d u 1:($2==%d ? $3:1/0) \"%%lf %%lf",ageminpar,fage,subdirf2(fileresu,"VPL_"),k1-1,k1-1,nres); */ |
|
/* k1-1 error should be nres-1*/ |
for (i=1; i<= nlstate ; i ++) { |
for (i=1; i<= nlstate ; i ++) { |
if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); |
if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); |
else fprintf(ficgp," %%*lf (%%*lf)"); |
else fprintf(ficgp," %%*lf (%%*lf)"); |
} |
} |
fprintf(ficgp,"\" t\"Period (stable) prevalence\" w l lt 0,\"%s\" every :::%d::%d u 1:($2==%d ? $3+1.96*$4 : 1/0) \"%%lf %%lf",subdirf2(fileresu,"VPL_"),k1-1,k1-1,nres); |
fprintf(ficgp,"\" t\"Period (stable) prevalence\" w l lt 0,\"%s\" every :::%d::%d u 1:($2==%d ? $3+1.96*$4 : 1/0) \"%%lf %%lf",subdirf2(fileresu,"VPL_"),nres-1,nres-1,nres); |
for (i=1; i<= nlstate ; i ++) { |
for (i=1; i<= nlstate ; i ++) { |
if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); |
if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); |
else fprintf(ficgp," %%*lf (%%*lf)"); |
else fprintf(ficgp," %%*lf (%%*lf)"); |
} |
} |
fprintf(ficgp,"\" t\"95%% CI\" w l lt 1,\"%s\" every :::%d::%d u 1:($2==%d ? $3-1.96*$4 : 1/0) \"%%lf %%lf",subdirf2(fileresu,"VPL_"),k1-1,k1-1,nres); |
fprintf(ficgp,"\" t\"95%% CI\" w l lt 1,\"%s\" every :::%d::%d u 1:($2==%d ? $3-1.96*$4 : 1/0) \"%%lf %%lf",subdirf2(fileresu,"VPL_"),nres-1,nres-1,nres); |
for (i=1; i<= nlstate ; i ++) { |
for (i=1; i<= nlstate ; i ++) { |
if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); |
if (i==cpt) fprintf(ficgp," %%lf (%%lf)"); |
else fprintf(ficgp," %%*lf (%%*lf)"); |
else fprintf(ficgp," %%*lf (%%*lf)"); |
Line 9108 int calandcheckages(int imx, int maxwav,
|
Line 9117 int calandcheckages(int imx, int maxwav,
|
*nberr = *nberr + 1; |
*nberr = *nberr + 1; |
if(firstone == 0){ |
if(firstone == 0){ |
firstone=1; |
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 do not believe in a death, skipped.\nOther similar cases in log file\n", *nberr,(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); |
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 do not believe in a death, skipped.\nOther similar cases in log file\n", *nberr,(int)moisdc[i],(int)andc[i],num[i],i,s[m][i],m); |
s[m][i]=-1; |
s[m][i]=-1; /* Droping the death status */ |
} |
} |
if((int)moisdc[i]==99 && (int)andc[i]!=9999 && s[m][i]>nlstate){ |
if((int)moisdc[i]==99 && (int)andc[i]!=9999 && s[m][i]>nlstate){ |
(*nberr)++; |
(*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]); |
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! 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]); |
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]=-1; /* We prefer to skip it (and to skip it in version 0.8a1 too */ |
s[m][i]=-2; /* We prefer to skip it (and to skip it in version 0.8a1 too */ |
} |
} |
} |
} |
} |
} |
Line 11268 Please run with mle=-1 to get a correct
|
Line 11277 Please run with mle=-1 to get a correct
|
fprintf(ficlog,"result: %s\n",resultline); |
fprintf(ficlog,"result: %s\n",resultline); |
break; |
break; |
case 14: |
case 14: |
if(ncovmodel >2){ |
if(ncovmodel >2 && nresult==0 ){ |
printf("ERROR: no result line! It should be at minimum 'result: V2=0 V1=1 or result:.' %s\n",line); |
printf("ERROR: no result lines! It should be at minimum 'result: V2=0 V1=1 or result:.' %s\n",line); |
goto end; |
goto end; |
} |
} |
|
break; |
default: |
default: |
nresult=1; |
nresult=1; |
decoderesult(".",nresult ); /* No covariate */ |
decoderesult(".",nresult ); /* No covariate */ |