--- imach/src/imach.c 2006/04/28 18:11:50 1.127 +++ imach/src/imach.c 2006/06/30 13:02:05 1.128 @@ -1,6 +1,9 @@ -/* $Id: imach.c,v 1.127 2006/04/28 18:11:50 brouard Exp $ +/* $Id: imach.c,v 1.128 2006/06/30 13:02:05 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.128 2006/06/30 13:02:05 brouard + (Module): Clarifications on computing e.j + Revision 1.127 2006/04/28 18:11:50 brouard (Module): Yes the sum of survivors was wrong since imach-114 because nhstepm was no more computed in the age @@ -383,11 +386,11 @@ extern int errno; #define ODIRSEPARATOR '/' #endif -/* $Id: imach.c,v 1.127 2006/04/28 18:11:50 brouard Exp $ */ +/* $Id: imach.c,v 1.128 2006/06/30 13:02:05 brouard Exp $ */ /* $State: Exp $ */ -char version[]="Imach version 0.98h, April 2006, INED-EUROREVES-Institut de longevite "; -char fullversion[]="$Revision: 1.127 $ $Date: 2006/04/28 18:11:50 $"; +char version[]="Imach version 0.98i, June 2006, INED-EUROREVES-Institut de longevite "; +char fullversion[]="$Revision: 1.128 $ $Date: 2006/06/30 13:02:05 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -1344,10 +1347,11 @@ double ***hpxij(double ***po, int nhstep for(i=1; i<=nlstate+ndeath; i++) for(j=1;j<=nlstate+ndeath;j++) { po[i][j][h]=newm[i][j]; - /*printf("i=%d j=%d h=%d po[i][j][h]=%f ",i,j,h,po[i][j][h]); - */ + /*if(h==nhstepm) printf("po[%d][%d][%d]=%f ",i,j,h,po[i][j][h]);*/ } + /*printf("h=%d ",h);*/ } /* end h */ +/* printf("\n H=%d \n",h); */ return po; } @@ -2264,7 +2268,8 @@ void prevalence(double ***probs, double if( i <= iagemax){ if(posprop>=1.e-5){ probs[i][jk][j1]= prop[jk][i]/posprop; - } + } else + printf("Warning Observed prevalence probs[%d][%d][%d]=%lf because of lack of cases\n",jk,i,j1,probs[i][jk][j1]); } }/* end jk */ }/* end i */ @@ -2868,7 +2873,7 @@ void varevsij(char optionfilefiname[], d pstamp(ficresvij); fprintf(ficresvij,"# Variance and covariance of health expectancies e.j \n# (weighted average of eij where weights are "); if(popbased==1) - fprintf(ficresvij,"the age specific prevalence observed in the population i.e cross-sectionally\n in each health state (popbased=1)"); + fprintf(ficresvij,"the age specific prevalence observed (cross-sectionally) in the population i.e cross-sectionally\n in each health state (popbased=1) (mobilav=%d\n",mobilav); else fprintf(ficresvij,"the age specific period (stable) prevalences in each health state \n"); fprintf(ficresvij,"# Age"); @@ -2896,8 +2901,7 @@ void varevsij(char optionfilefiname[], d /* hstepm beeing the number of stepms, if hstepm=1 the length of hstepm is stepm. nhstepm is the number of hstepm from age to agelim nstepm is the number of stepm from age to agelin. - Look at hpijx to understand the reason of that which relies in memory size - and note for a fixed period like k years */ + Look at function hpijx to understand why (it is linked to memory size questions) */ /* We decided (b) to get a life expectancy respecting the most precise curvature of the survival function given by stepm (the optimization length). Unfortunately it means that if the survival funtion is printed every two years of age and if @@ -2963,7 +2967,7 @@ void varevsij(char optionfilefiname[], d } } - for(j=1; j<= nlstate; j++){ + for(j=1; j<= nlstate; j++){ /* Sum of wi * eij = e.j */ for(h=0; h<=nhstepm; h++){ for(i=1, gm[h][j]=0.;i<=nlstate;i++) gm[h][j] += prlim[i][i]*p3mat[i][j][h]; @@ -3523,7 +3527,7 @@ void printinghtml(char fileres[], char t - Period (stable) prevalence in each health state: %s
\n", subdirf2(fileres,"pl"),subdirf2(fileres,"pl")); fprintf(fichtm,"\ - - (a) Life expectancies by health status at initial age, (b) health expectancies by health status at initial age: ei., eij . If one or more covariate are included, specific tables for each value of the covariate are output in sequences within the same file (estepm=%2d months): \ + - (a) Life expectancies by health status at initial age, ei. (b) health expectancies by health status at initial age, eij . If one or more covariates are included, specific tables for each value of the covariate are output in sequences within the same file (estepm=%2d months): \ %s
\n", estepm,subdirf2(fileres,"e"),subdirf2(fileres,"e")); fprintf(fichtm,"\ @@ -3588,11 +3592,11 @@ fprintf(fichtm," \n