/* $Id$
$State$
$Log$
+ Revision 1.95 2003/07/08 07:54:34 brouard
+ * imach.c (Repository):
+ (Repository): Using imachwizard code to output a more meaningful covariance
+ matrix (cov(a12,c31) instead of numbers.
+
Revision 1.94 2003/06/27 13:00:02 brouard
Just cleaning
/* $Id$ */
/* $State$ */
-char version[]="Imach version 0.96b, June 2003, INED-EUROREVES ";
+char version[]="Imach version 0.96c, July 2003, INED-EUROREVES ";
char fullversion[]="$Revision$ $Date$";
int erreur, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */
int nvar;
char title[MAXLINE];
char optionfile[FILENAMELENGTH], datafile[FILENAMELENGTH], filerespl[FILENAMELENGTH];
char optionfilext[10], optionfilefiname[FILENAMELENGTH], plotcmd[FILENAMELENGTH];
-char tmpout[FILENAMELENGTH];
+char tmpout[FILENAMELENGTH], tmpout2[FILENAMELENGTH];
char command[FILENAMELENGTH];
int outcmd=0;
fprintf(ficgp, "**********\n#\n");
- fprintf(fichtm, "\n<hr size=\"2\" color=\"#EC5E5E\">********** Variable ");
+ fprintf(fichtmcov, "\n<hr size=\"2\" color=\"#EC5E5E\">********** Variable ");
for (z1=1; z1<=cptcoveff; z1++) fprintf(fichtm, "V%d=%d ",Tvaraff[z1],nbcode[Tvaraff[z1]][codtab[j1][z1]]);
- fprintf(fichtm, "**********\n<hr size=\"2\" color=\"#EC5E5E\">");
+ fprintf(fichtmcov, "**********\n<hr size=\"2\" color=\"#EC5E5E\">");
fprintf(ficresprobcor, "\n#********** Variable ");
for (z1=1; z1<=cptcoveff; z1++) fprintf(ficresprobcor, "V%d=%d ",Tvaraff[z1],nbcode[Tvaraff[z1]][codtab[j1][z1]]);
double jprev1, double mprev1,double anprev1, \
double jprev2, double mprev2,double anprev2){
int jj1, k1, i1, cpt;
- /*char optionfilehtm[FILENAMELENGTH];*/
-/* if((fichtm=fopen(optionfilehtm,"a"))==NULL) { */
-/* printf("Problem with %s \n",optionfilehtm), exit(0); */
-/* fprintf(ficlog,"Problem with %s \n",optionfilehtm), exit(0); */
-/* } */
fprintf(fichtm,"<ul><li><h4>Result files (first order: no variance)</h4>\n \
- - Observed prevalence in each state (during the period defined between %.lf/%.lf/%.lf and %.lf/%.lf/%.lf): <a href=\"%s\">%s</a> <br>\n \
- - Estimated transition probabilities over %d (stepm) months: <a href=\"%s\">%s</a><br>\n \
- - Stable prevalence in each health state: <a href=\"%s\">%s</a> <br>\n \
+ - Observed prevalence in each state (during the period defined between %.lf/%.lf/%.lf and %.lf/%.lf/%.lf): <a href=\"%s\">%s</a> <br>\n ",
+ jprev1, mprev1,anprev1,jprev2, mprev2,anprev2,subdirf2(fileres,"p"),subdirf2(fileres,"p"));
+ fprintf(fichtm,"\
+ - Estimated transition probabilities over %d (stepm) months: <a href=\"%s\">%s</a><br>\n ",
+ stepm,subdirf2(fileres,"pij"),subdirf2(fileres,"pij"));
+ fprintf(fichtm,"\
+ - Stable prevalence in each health state: <a href=\"%s\">%s</a> <br>\n",
+ subdirf2(fileres,"pl"),subdirf2(fileres,"pl"));
+ fprintf(fichtm,"\
- Life expectancies by age and initial health status (estepm=%2d months): \
- <a href=\"%s\">%s</a> <br>\n</li>", \
- jprev1, mprev1,anprev1,jprev2, mprev2,anprev2,subdirf2(fileres,"p"),subdirf2(fileres,"p"),\
- stepm,subdirf2(fileres,"pij"),subdirf2(fileres,"pij"),\
- subdirf2(fileres,"pl"),subdirf2(fileres,"pl"),\
+ <a href=\"%s\">%s</a> <br>\n</li>",
estepm,subdirf2(fileres,"e"),subdirf2(fileres,"e"));
fprintf(fichtm," \n<ul><li><b>Graphs</b></li><p>");
fprintf(fichtm,"\n<br>- Health life expectancies by age and initial health state (%d): %s%d%d.png <br> \
<img src=\"%s%d%d.png\">",cpt,subdirf2(optionfilefiname,"exp"),cpt,jj1,subdirf2(optionfilefiname,"exp"),cpt,jj1);
}
- fprintf(fichtm,"\n<br>- Total life expectancy by age and \
-health expectancies in states (1) and (2): %s%d.png<br>\
-<img src=\"%s%d.png\">",subdirf2(optionfilefiname,"e"),jj1,subdirf2(optionfilefiname,"e"),jj1);
} /* end i1 */
}/* End k1 */
fprintf(fichtm,"</ul>");
- fprintf(fichtm,"\n<br><li><h4> Result files (second order: variances)</h4>\n\
- - Parameter file with estimated parameters and covariance matrix: <a href=\"%s\">%s</a> <br>\n\
- - Variance of one-step probabilities: <a href=\"%s\">%s</a> <br>\n\
- - Variance-covariance of one-step probabilities: <a href=\"%s\">%s</a> <br>\n\
- - Correlation matrix of one-step probabilities: <a href=\"%s\">%s</a> <br>\n\
- - Variances and covariances of life expectancies by age and initial health status (estepm=%d months): <a href=\"%s\">%s</a><br>\n\
- - Health expectancies with their variances (no covariance): <a href=\"%s\">%s</a> <br>\n\
+ fprintf(fichtm,"\
+\n<br><li><h4> Result files (second order: variances)</h4>\n\
+ - Parameter file with estimated parameters and covariance matrix: <a href=\"%s\">%s</a> <br>\n", rfileres,rfileres);
+
+ fprintf(fichtm," - Variance of one-step probabilities: <a href=\"%s\">%s</a> <br>\n",
+ subdirf2(fileres,"prob"),subdirf2(fileres,"prob"));
+ fprintf(fichtm,"\
+ - Variance-covariance of one-step probabilities: <a href=\"%s\">%s</a> <br>\n",
+ subdirf2(fileres,"probcov"),subdirf2(fileres,"probcov"));
+
+ fprintf(fichtm,"\
+ - Correlation matrix of one-step probabilities: <a href=\"%s\">%s</a> <br>\n",
+ subdirf2(fileres,"probcor"),subdirf2(fileres,"probcor"));
+ fprintf(fichtm,"\
+ - Variances and covariances of life expectancies by age and initial health status (estepm=%d months): <a href=\"%s\">%s</a><br>\n",
+ estepm, subdirf2(fileres,"v"),subdirf2(fileres,"v"));
+ fprintf(fichtm,"\
+ - Health expectancies with their variances (no covariance): <a href=\"%s\">%s</a> <br>\n",
+ subdirf2(fileres,"t"),subdirf2(fileres,"t"));
+ fprintf(fichtm,"\
- Standard deviation of stable prevalences: <a href=\"%s\">%s</a> <br>\n",\
- rfileres,rfileres,\
- subdirf2(fileres,"prob"),subdirf2(fileres,"prob"),\
- subdirf2(fileres,"probcov"),subdirf2(fileres,"probcov"),\
- subdirf2(fileres,"probcor"),subdirf2(fileres,"probcor"),\
- estepm, subdirf2(fileres,"v"),subdirf2(fileres,"v"),\
- subdirf2(fileres,"t"),subdirf2(fileres,"t"),\
subdirf2(fileres,"vpl"),subdirf2(fileres,"vpl"));
/* if(popforecast==1) fprintf(fichtm,"\n */
/* <br>",fileres,fileres,fileres,fileres); */
/* else */
/* fprintf(fichtm,"\n No population forecast: popforecast = %d (instead of 1) or stepm = %d (instead of 1) or model=%s (instead of .)<br><br></li>\n",popforecast, stepm, model); */
-fprintf(fichtm," <ul><li><b>Graphs</b></li><p>");
+ fflush(fichtm);
+ fprintf(fichtm," <ul><li><b>Graphs</b></li><p>");
m=cptcoveff;
if (cptcovn < 1) {m=1;ncodemax[1]=1;}
prevalence (with 95%% confidence interval) in state (%d): %s%d%d.png <br>\
<img src=\"%s%d%d.png\">",cpt,subdirf2(optionfilefiname,"v"),cpt,jj1,subdirf2(optionfilefiname,"v"),cpt,jj1);
}
+ fprintf(fichtm,"\n<br>- Total life expectancy by age and \
+health expectancies in states (1) and (2): %s%d.png<br>\
+<img src=\"%s%d.png\">",subdirf2(optionfilefiname,"e"),jj1,subdirf2(optionfilefiname,"e"),jj1);
} /* end i1 */
}/* End k1 */
fprintf(fichtm,"</ul>");
fclose(ficrespij);
probs= ma3x(1,AGESUP,1,NCOVMAX, 1,NCOVMAX);
+ for(i=1;i<=AGESUP;i++)
+ for(j=1;j<=NCOVMAX;j++)
+ for(k=1;k<=NCOVMAX;k++)
+ probs[i][j][k]=0.;
/*---------- Forecasting ------------------*/
/*if((stepm == 1) && (strcmp(model,".")==0)){*/