--- imach/src/imach.c 2001/05/02 18:44:18 1.9 +++ imach/src/imach.c 2001/05/17 16:07:14 1.11 @@ -8,7 +8,7 @@ Health expectancies are computed from the transistions observed between waves and are computed for each degree of severity of disability (number of life states). More degrees you consider, more time is necessary to - reach the Maximum Likelihood of the parameters involved in the model. + reach the Maximum Likelihood of the parameters involved in the model. The simplest model is the multinomial logistic model where pij is the probabibility to be observed in state j at the second wave conditional to be observed in state i at the first wave. Therefore the model is: @@ -1270,11 +1270,11 @@ void concatwav(int wav[], int **dh, int /* int j, k=0,jk, ju, jl,jmin=1e+5, jmax=-1; double sum=0., jmean=0.;*/ -int j, k=0,jk, ju, jl; - double sum=0.; -jmin=1e+5; - jmax=-1; -jmean=0.; + int j, k=0,jk, ju, jl; + double sum=0.; + jmin=1e+5; + jmax=-1; + jmean=0.; for(i=1; i<=imx; i++){ mi=0; m=firstpass; @@ -1304,17 +1304,18 @@ jmean=0.; dh[mi][i]=1; else{ if (s[mw[mi+1][i]][i] > nlstate) { + if (agedc[i] < 2*AGESUP) { j= rint(agedc[i]*12-agev[mw[mi][i]][i]*12); - /*if ((j<0) || (j>28)) printf("j=%d num=%d ",j,i);*/ if(j==0) j=1; /* Survives at least one month after exam */ k=k+1; if (j >= jmax) jmax=j; - else if (j <= jmin)jmin=j; + if (j <= jmin) jmin=j; sum=sum+j; + if (j<0) printf("j=%d num=%d ",j,i); + } } else{ j= rint( (agev[mw[mi+1][i]][i]*12 - agev[mw[mi][i]][i]*12)); - /*if ((j<0) || (j>28)) printf("j=%d num=%d ",j,i);*/ k=k+1; if (j >= jmax) jmax=j; else if (j <= jmin)jmin=j; @@ -1676,7 +1677,7 @@ int main() double ***eij, ***vareij; double **varpl; /* Variances of prevalence limits by age */ double *epj, vepp; - char version[80]="Imach version 62c, May 1999, INED-EUROREVES "; + char version[80]="Imach version 64b, May 2001, INED-EUROREVES "; char *alph[]={"a","a","b","c","d","e"}, str[4]; char z[1]="c", occ; @@ -2670,7 +2671,9 @@ strcpy(fileresvpl,"vpl"); chdir(pathcd); #endif /*system("wgnuplot graph.plt");*/ - system("../gp37mgw/wgnuplot graph.plt"); + /*system("../gp37mgw/wgnuplot graph.plt");*/ + /*system("cd ../gp37mgw");*/ + system("..\\gp37mgw\\wgnuplot graph.plt"); #ifdef windows while (z[0] != 'q') { @@ -2680,7 +2683,7 @@ strcpy(fileresvpl,"vpl"); if (z[0] == 'c') system("./imach"); else if (z[0] == 'e') { chdir(path); - system("index.htm"); + system(optionfilehtm); } else if (z[0] == 'q') exit(0); }