version 1.335, 2022/08/31 08:23:16
|
version 1.337, 2022/09/02 14:26:02
|
Line 1
|
Line 1
|
/* $Id$ |
/* $Id$ |
$State$ |
$State$ |
$Log$ |
$Log$ |
|
Revision 1.337 2022/09/02 14:26:02 brouard |
|
Summary: version 0.99r35 |
|
|
|
* src/imach.c: Version 0.99r35 because it outputs same results with |
|
1+age+V1+V1*age for females and 1+age for females only |
|
(education=1 noweight) |
|
|
|
Revision 1.336 2022/08/31 09:52:36 brouard |
|
*** empty log message *** |
|
|
Revision 1.335 2022/08/31 08:23:16 brouard |
Revision 1.335 2022/08/31 08:23:16 brouard |
Summary: improvements... |
Summary: improvements... |
|
|
Line 1288 typedef struct {
|
Line 1298 typedef struct {
|
/* $State$ */ |
/* $State$ */ |
#include "version.h" |
#include "version.h" |
char version[]=__IMACH_VERSION__; |
char version[]=__IMACH_VERSION__; |
char copyright[]="August 2022,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015-2020, Nihon University 2021-202, INED 2000-2022"; |
char copyright[]="September 2022,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015-2020, Nihon University 2021-202, INED 2000-2022"; |
char fullversion[]="$Revision$ $Date$"; |
char fullversion[]="$Revision$ $Date$"; |
char strstart[80]; |
char strstart[80]; |
char optionfilext[10], optionfilefiname[FILENAMELENGTH]; |
char optionfilext[10], optionfilefiname[FILENAMELENGTH]; |
Line 1505 int **nbcode, *Tvar; /**< model=V2 => Tv
|
Line 1515 int **nbcode, *Tvar; /**< model=V2 => Tv
|
/*Tvar[k]= 5 4 3 6 5 2 7 1 1 */ |
/*Tvar[k]= 5 4 3 6 5 2 7 1 1 */ |
/* nsd 1 2 3 */ /* Counting single dummies covar fixed or tv */ |
/* nsd 1 2 3 */ /* Counting single dummies covar fixed or tv */ |
/*TnsdVar[Tvar] 1 2 3 */ |
/*TnsdVar[Tvar] 1 2 3 */ |
|
/*Tvaraff[nsd] 4 3 1 */ /* ID of single dummy cova fixed or timevary*/ |
/*TvarsD[nsd] 4 3 1 */ /* ID of single dummy cova fixed or timevary*/ |
/*TvarsD[nsd] 4 3 1 */ /* ID of single dummy cova fixed or timevary*/ |
/*TvarsDind[k] 2 3 9 */ /* position K of single dummy cova */ |
/*TvarsDind[k] 2 3 9 */ /* position K of single dummy cova */ |
/* nsq 1 2 */ /* Counting single quantit tv */ |
/* nsq 1 2 */ /* Counting single quantit tv */ |
Line 2507 void powell(double p[], double **xi, int
|
Line 2518 void powell(double p[], double **xi, int
|
/* (void) gettimeofday(&curr_time,&tzp); */ |
/* (void) gettimeofday(&curr_time,&tzp); */ |
rcurr_time = time(NULL); |
rcurr_time = time(NULL); |
curr_time = *localtime(&rcurr_time); |
curr_time = *localtime(&rcurr_time); |
printf("\nPowell iter=%d -2*LL=%.12f gain=%.12f=%.3g %ld sec. %ld sec.",*iter,*fret, fp-*fret,fp-*fret, rcurr_time-rlast_time, rcurr_time-rstart_time);fflush(stdout); |
/* printf("\nPowell iter=%d -2*LL=%.12f gain=%.12f=%.3g %ld sec. %ld sec.",*iter,*fret, fp-*fret,fp-*fret, rcurr_time-rlast_time, rcurr_time-rstart_time);fflush(stdout); */ |
fprintf(ficlog,"\nPowell iter=%d -2*LL=%.12f gain=%.12f=%.3g %ld sec. %ld sec.",*iter,*fret, fp-*fret,fp-*fret,rcurr_time-rlast_time, rcurr_time-rstart_time); fflush(ficlog); |
/* fprintf(ficlog,"\nPowell iter=%d -2*LL=%.12f gain=%.12f=%.3g %ld sec. %ld sec.",*iter,*fret, fp-*fret,fp-*fret,rcurr_time-rlast_time, rcurr_time-rstart_time); fflush(ficlog); */ |
|
printf("\nPowell iter=%d -2*LL=%.12f gain=%.3lg %ld sec. %ld sec.",*iter,*fret,fp-*fret, rcurr_time-rlast_time, rcurr_time-rstart_time);fflush(stdout); |
|
fprintf(ficlog,"\nPowell iter=%d -2*LL=%.12f gain=%.3lg %ld sec. %ld sec.",*iter,*fret,fp-*fret,rcurr_time-rlast_time, rcurr_time-rstart_time); fflush(ficlog); |
/* fprintf(ficrespow,"%d %.12f %ld",*iter,*fret,curr_time.tm_sec-start_time.tm_sec); */ |
/* fprintf(ficrespow,"%d %.12f %ld",*iter,*fret,curr_time.tm_sec-start_time.tm_sec); */ |
fp=(*fret); /* From former iteration or initial value */ |
fp=(*fret); /* From former iteration or initial value */ |
for (i=1;i<=n;i++) { |
for (i=1;i<=n;i++) { |
Line 3508 double **matprod2(double **out, double *
|
Line 3521 double **matprod2(double **out, double *
|
|
|
double ***hpxij(double ***po, int nhstepm, double age, int hstepm, double *x, int nlstate, int stepm, double **oldm, double **savm, int ij, int nres ) |
double ***hpxij(double ***po, int nhstepm, double age, int hstepm, double *x, int nlstate, int stepm, double **oldm, double **savm, int ij, int nres ) |
{ |
{ |
/* Computes the transition matrix starting at age 'age' and dummies values in each resultline (loop on ij to find the corresponding combination) to over |
/* Already optimized with precov. |
|
Computes the transition matrix starting at age 'age' and dummies values in each resultline (loop on ij to find the corresponding combination) to over |
'nhstepm*hstepm*stepm' months (i.e. until |
'nhstepm*hstepm*stepm' months (i.e. until |
age (in years) age+nhstepm*hstepm*stepm/12) by multiplying |
age (in years) age+nhstepm*hstepm*stepm/12) by multiplying |
nhstepm*hstepm matrices. |
nhstepm*hstepm matrices. |
Line 3839 double ***hbxij(double ***po, int nhstep
|
Line 3853 double ***hbxij(double ***po, int nhstep
|
/*************** log-likelihood *************/ |
/*************** log-likelihood *************/ |
double func( double *x) |
double func( double *x) |
{ |
{ |
int i, ii, j, k, mi, d, kk; |
int i, ii, j, k, mi, d, kk, kf=0; |
int ioffset=0; |
int ioffset=0; |
double l, ll[NLSTATEMAX+1], cov[NCOVMAX+1]; |
double l, ll[NLSTATEMAX+1], cov[NCOVMAX+1]; |
double **out; |
double **out; |
double lli; /* Individual log likelihood */ |
double lli; /* Individual log likelihood */ |
int s1, s2; |
int s1, s2; |
int iv=0, iqv=0, itv=0, iqtv=0 ; /* Index of varying covariate, fixed quantitative cov, time varying covariate, quantitative time varying covariate */ |
int iv=0, iqv=0, itv=0, iqtv=0 ; /* Index of varying covariate, fixed quantitative cov, time varying covariate, quantitative time varying covariate */ |
|
|
double bbh, survp; |
double bbh, survp; |
long ipmx; |
|
double agexact; |
double agexact; |
|
double agebegin, ageend; |
/*extern weight */ |
/*extern weight */ |
/* We are differentiating ll according to initial status */ |
/* We are differentiating ll according to initial status */ |
/* for (i=1;i<=npar;i++) printf("%f ", x[i]);*/ |
/* for (i=1;i<=npar;i++) printf("%f ", x[i]);*/ |
Line 3871 double func( double *x)
|
Line 3886 double func( double *x)
|
*/ |
*/ |
ioffset=2+nagesqr ; |
ioffset=2+nagesqr ; |
/* Fixed */ |
/* Fixed */ |
for (k=1; k<=ncovf;k++){ /* For each fixed covariate dummu or quant or prod */ |
for (kf=1; kf<=ncovf;kf++){ /* For each fixed covariate dummu or quant or prod */ |
/* # V1=sex, V2=raedyrs Quant Fixed, State=livarnb4..livarnb11, V3=iadl4..iald11, V4=adlw4..adlw11, V5=r4bmi..r11bmi */ |
/* # V1=sex, V2=raedyrs Quant Fixed, State=livarnb4..livarnb11, V3=iadl4..iald11, V4=adlw4..adlw11, V5=r4bmi..r11bmi */ |
/* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1 */ |
/* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1 */ |
/* TvarF[1]=Tvar[6]=2, TvarF[2]=Tvar[7]=7, TvarF[3]=Tvar[9]=1 ID of fixed covariates or product V2, V1*V2, V1 */ |
/* TvarF[1]=Tvar[6]=2, TvarF[2]=Tvar[7]=7, TvarF[3]=Tvar[9]=1 ID of fixed covariates or product V2, V1*V2, V1 */ |
/* TvarFind; TvarFind[1]=6, TvarFind[2]=7, TvarFind[3]=9 *//* Inverse V2(6) is first fixed (single or prod) */ |
/* TvarFind; TvarFind[1]=6, TvarFind[2]=7, TvarFind[3]=9 *//* Inverse V2(6) is first fixed (single or prod) */ |
cov[ioffset+TvarFind[k]]=covar[Tvar[TvarFind[k]]][i];/* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1, only V1 is fixed (TvarFind[1]=6)*/ |
cov[ioffset+TvarFind[kf]]=covar[Tvar[TvarFind[kf]]][i];/* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1, only V1 is fixed (TvarFind[1]=6)*/ |
/* V1*V2 (7) TvarFind[2]=7, TvarFind[3]=9 */ |
/* V1*V2 (7) TvarFind[2]=7, TvarFind[3]=9 */ |
} |
} |
/* In model V2+V1*V4+age*V3+V3*V2 Tvar[1] is V2, Tvar[2=V1*V4] |
/* In model V2+V1*V4+age*V3+V3*V2 Tvar[1] is V2, Tvar[2=V1*V4] |
Line 3891 double func( double *x)
|
Line 3906 double func( double *x)
|
But if the variable is not in the model TTvar[iv] is the real variable effective in the model: |
But if the variable is not in the model TTvar[iv] is the real variable effective in the model: |
meaning that decodemodel should be used cotvar[mw[mi+1][i]][TTvar[iv]][i] |
meaning that decodemodel should be used cotvar[mw[mi+1][i]][TTvar[iv]][i] |
*/ |
*/ |
for(mi=1; mi<= wav[i]-1; mi++){ |
for(mi=1; mi<= wav[i]-1; mi++){ /* Varying with waves */ |
|
/* Wave varying (but not age varying) */ |
for(k=1; k <= ncovv ; k++){ /* Varying covariates in the model (single and product but no age )"V5+V4+V3+V4*V3+V5*age+V1*age+V1" +TvarVind 1,2,3,4(V4*V3) Tvar[1]@7{5, 4, 3, 6, 5, 1, 1 ; 6 because the created covar is after V5 and is 6, minus 1+1, 3,2,1,4 positions in cotvar*/ |
for(k=1; k <= ncovv ; k++){ /* Varying covariates in the model (single and product but no age )"V5+V4+V3+V4*V3+V5*age+V1*age+V1" +TvarVind 1,2,3,4(V4*V3) Tvar[1]@7{5, 4, 3, 6, 5, 1, 1 ; 6 because the created covar is after V5 and is 6, minus 1+1, 3,2,1,4 positions in cotvar*/ |
/* cov[ioffset+TvarVind[k]]=cotvar[mw[mi][i]][Tvar[TvarVind[k]]][i]; but where is the crossproduct? */ |
/* cov[ioffset+TvarVind[k]]=cotvar[mw[mi][i]][Tvar[TvarVind[k]]][i]; but where is the crossproduct? */ |
cov[ioffset+TvarVind[k]]=cotvar[mw[mi][i]][Tvar[TvarVind[k]]-ncovcol-nqv][i]; |
cov[ioffset+TvarVind[k]]=cotvar[mw[mi][i]][Tvar[TvarVind[k]]-ncovcol-nqv][i]; |
Line 3901 double func( double *x)
|
Line 3917 double func( double *x)
|
oldm[ii][j]=(ii==j ? 1.0 : 0.0); |
oldm[ii][j]=(ii==j ? 1.0 : 0.0); |
savm[ii][j]=(ii==j ? 1.0 : 0.0); |
savm[ii][j]=(ii==j ? 1.0 : 0.0); |
} |
} |
|
|
|
agebegin=agev[mw[mi][i]][i]; /* Age at beginning of effective wave */ |
|
ageend=agev[mw[mi][i]][i] + (dh[mi][i])*stepm/YEARM; /* Age at end of effective wave and at the end of transition */ |
for(d=0; d<dh[mi][i]; d++){ |
for(d=0; d<dh[mi][i]; d++){ |
newm=savm; |
newm=savm; |
agexact=agev[mw[mi][i]][i]+d*stepm/YEARM; |
agexact=agev[mw[mi][i]][i]+d*stepm/YEARM; |
Line 3991 double func( double *x)
|
Line 4010 double func( double *x)
|
/*survp += out[s1][j]; */ |
/*survp += out[s1][j]; */ |
lli= log(survp); |
lli= log(survp); |
} |
} |
else if (s2==-4) { |
/* else if (s2==-4) { */ |
for (j=3,survp=0. ; j<=nlstate; j++) |
/* for (j=3,survp=0. ; j<=nlstate; j++) */ |
survp += (1.+bbh)*out[s1][j]- bbh*savm[s1][j]; |
/* survp += (1.+bbh)*out[s1][j]- bbh*savm[s1][j]; */ |
lli= log(survp); |
/* lli= log(survp); */ |
} |
/* } */ |
else if (s2==-5) { |
/* else if (s2==-5) { */ |
for (j=1,survp=0. ; j<=2; j++) |
/* for (j=1,survp=0. ; j<=2; j++) */ |
survp += (1.+bbh)*out[s1][j]- bbh*savm[s1][j]; |
/* survp += (1.+bbh)*out[s1][j]- bbh*savm[s1][j]; */ |
lli= log(survp); |
/* lli= log(survp); */ |
} |
/* } */ |
else{ |
else{ |
lli= log((1.+bbh)*out[s1][s2]- bbh*savm[s1][s2]); /* linear interpolation */ |
lli= log((1.+bbh)*out[s1][s2]- bbh*savm[s1][s2]); /* linear interpolation */ |
/* lli= (savm[s1][s2]>(double)1.e-8 ?log((1.+bbh)*out[s1][s2]- bbh*(savm[s1][s2])):log((1.+bbh)*out[s1][s2]));*/ /* linear interpolation */ |
/* lli= (savm[s1][s2]>(double)1.e-8 ?log((1.+bbh)*out[s1][s2]- bbh*(savm[s1][s2])):log((1.+bbh)*out[s1][s2]));*/ /* linear interpolation */ |
Line 4198 double funcone( double *x)
|
Line 4217 double funcone( double *x)
|
for(k=1; k<=nlstate; k++) ll[k]=0.; |
for(k=1; k<=nlstate; k++) ll[k]=0.; |
ioffset=0; |
ioffset=0; |
for (i=1,ipmx=0, sw=0.; i<=imx; i++){ |
for (i=1,ipmx=0, sw=0.; i<=imx; i++){ |
|
/* Computes the values of the ncovmodel covariates of the model |
|
depending if the covariates are fixed or varying (age dependent) and stores them in cov[] |
|
Then computes with function pmij which return a matrix p[i][j] giving the elementary probability |
|
to be observed in j being in i according to the model. |
|
*/ |
/* ioffset=2+nagesqr+cptcovage; */ |
/* ioffset=2+nagesqr+cptcovage; */ |
ioffset=2+nagesqr; |
ioffset=2+nagesqr; |
/* Fixed */ |
/* Fixed */ |
Line 4215 double funcone( double *x)
|
Line 4239 double funcone( double *x)
|
/* cov[2+9]=covar[Tvar[9]][i]; */ |
/* cov[2+9]=covar[Tvar[9]][i]; */ |
/* cov[2+9]=covar[1][i]; V1 */ |
/* cov[2+9]=covar[1][i]; V1 */ |
} |
} |
|
/* In model V2+V1*V4+age*V3+V3*V2 Tvar[1] is V2, Tvar[2=V1*V4] |
|
is 5, Tvar[3=age*V3] should not be computed because of age Tvar[4=V3*V2]=6 |
|
has been calculated etc */ |
|
/* For an individual i, wav[i] gives the number of effective waves */ |
|
/* We compute the contribution to Likelihood of each effective transition |
|
mw[mi][i] is real wave of the mi th effectve wave */ |
|
/* Then statuses are computed at each begin and end of an effective wave s1=s[ mw[mi][i] ][i]; |
|
s2=s[mw[mi+1][i]][i]; |
|
And the iv th varying covariate is the cotvar[mw[mi+1][i]][iv][i] |
|
But if the variable is not in the model TTvar[iv] is the real variable effective in the model: |
|
meaning that decodemodel should be used cotvar[mw[mi+1][i]][TTvar[iv]][i] |
|
*/ |
|
/* This part may be useless now because everythin should be in covar */ |
/* for (k=1; k<=nqfveff;k++){ /\* Simple and product fixed Quantitative covariates without age* products *\/ */ |
/* for (k=1; k<=nqfveff;k++){ /\* Simple and product fixed Quantitative covariates without age* products *\/ */ |
/* cov[++ioffset]=coqvar[TvarFQ[k]][i];/\* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1, only V2 and V1*V2 is fixed (k=6 and 7?)*\/ */ |
/* cov[++ioffset]=coqvar[TvarFQ[k]][i];/\* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1, only V2 and V1*V2 is fixed (k=6 and 7?)*\/ */ |
/* } */ |
/* } */ |
Line 4272 double funcone( double *x)
|
Line 4309 double funcone( double *x)
|
savm=oldm; |
savm=oldm; |
oldm=newm; |
oldm=newm; |
} /* end mult */ |
} /* end mult */ |
|
/*lli=log(out[s[mw[mi][i]][i]][s[mw[mi+1][i]][i]]);*/ /* Original formula */ |
|
/* But now since version 0.9 we anticipate for bias at large stepm. |
|
* If stepm is larger than one month (smallest stepm) and if the exact delay |
|
* (in months) between two waves is not a multiple of stepm, we rounded to |
|
* the nearest (and in case of equal distance, to the lowest) interval but now |
|
* we keep into memory the bias bh[mi][i] and also the previous matrix product |
|
* (i.e to dh[mi][i]-1) saved in 'savm'. Then we inter(extra)polate the |
|
* probability in order to take into account the bias as a fraction of the way |
|
* from savm to out if bh is negative or even beyond if bh is positive. bh varies |
|
* -stepm/2 to stepm/2 . |
|
* For stepm=1 the results are the same as for previous versions of Imach. |
|
* For stepm > 1 the results are less biased than in previous versions. |
|
*/ |
s1=s[mw[mi][i]][i]; |
s1=s[mw[mi][i]][i]; |
s2=s[mw[mi+1][i]][i]; |
s2=s[mw[mi+1][i]][i]; |
/* if(s2==-1){ */ |
/* if(s2==-1){ */ |
Line 6234 void concatwav(int wav[], int **dh, int
|
Line 6283 void concatwav(int wav[], int **dh, int
|
/* Covariances of health expectancies eij and of total life expectancies according |
/* Covariances of health expectancies eij and of total life expectancies according |
to initial status i, ei. . |
to initial status i, ei. . |
*/ |
*/ |
|
/* Very time consuming function, but already optimized with precov */ |
int i, j, nhstepm, hstepm, h, nstepm, k, cptj, cptj2, i2, j2, ij, ji; |
int i, j, nhstepm, hstepm, h, nstepm, k, cptj, cptj2, i2, j2, ij, ji; |
int nhstepma, nstepma; /* Decreasing with age */ |
int nhstepma, nstepma; /* Decreasing with age */ |
double age, agelim, hf; |
double age, agelim, hf; |
Line 6502 void concatwav(int wav[], int **dh, int
|
Line 6552 void concatwav(int wav[], int **dh, int
|
pstamp(ficresprobmorprev); |
pstamp(ficresprobmorprev); |
fprintf(ficresprobmorprev,"# probabilities of dying before estepm=%d months for people of exact age and weighted probabilities w1*p1j+w2*p2j+... stand dev in()\n",estepm); |
fprintf(ficresprobmorprev,"# probabilities of dying before estepm=%d months for people of exact age and weighted probabilities w1*p1j+w2*p2j+... stand dev in()\n",estepm); |
fprintf(ficresprobmorprev,"# Selected quantitative variables and dummies"); |
fprintf(ficresprobmorprev,"# Selected quantitative variables and dummies"); |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ /* To be done*/ |
|
fprintf(ficresprobmorprev," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* We use TinvDoQresult[nres][resultmodel[nres][j] we sort according to the equation model and the resultline: it is a choice */ |
|
/* for (j=1; j<= nsq; j++){ /\* For each selected (single) quantitative value *\/ /\* To be done*\/ */ |
|
/* fprintf(ficresprobmorprev," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
|
/* } */ |
|
for (j=1; j<= cptcovs; j++){ /* For each selected (single) quantitative value */ /* To be done*/ |
|
fprintf(ficresprobmorprev," V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
} |
} |
for(j=1;j<=cptcoveff;j++) |
/* for(j=1;j<=cptcoveff;j++) */ |
fprintf(ficresprobmorprev," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(ij,TnsdVar[Tvaraff[j]])]); |
/* fprintf(ficresprobmorprev," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(ij,TnsdVar[Tvaraff[j]])]); */ |
fprintf(ficresprobmorprev,"\n"); |
fprintf(ficresprobmorprev,"\n"); |
|
|
fprintf(ficresprobmorprev,"# Age cov=%-d",ij); |
fprintf(ficresprobmorprev,"# Age cov=%-d",ij); |
Line 7177 To be simple, these graphs help to under
|
Line 7232 To be simple, these graphs help to under
|
} |
} |
}else if(Dummy[modelresult[nres][z1]]==1){ /* Quanti variable */ |
}else if(Dummy[modelresult[nres][z1]]==1){ /* Quanti variable */ |
/* For each selected (single) quantitative value */ |
/* For each selected (single) quantitative value */ |
fprintf(ficresprob," V%d=%f ",Tvqresult[nres][z1],Tqresult[nres][z1]); |
fprintf(ficresprob," V%d=%lg ",Tvqresult[nres][z1],Tqresult[nres][z1]); |
if(Fixed[modelresult[nres][z1]]==0){ /* Fixed */ |
if(Fixed[modelresult[nres][z1]]==0){ /* Fixed */ |
fprintf(ficresprob,"fixed "); |
fprintf(ficresprob,"fixed "); |
fprintf(ficresprobcov,"fixed "); |
fprintf(ficresprobcov,"fixed "); |
Line 7524 void printinghtml(char fileresu[], char
|
Line 7579 void printinghtml(char fileresu[], char
|
jj1=0; |
jj1=0; |
|
|
fprintf(fichtm," \n<ul>"); |
fprintf(fichtm," \n<ul>"); |
for(nres=1; nres <= nresult; nres++) /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k1=1; k1<=m;k1++){ /* For each combination of covariate */ |
/* k1=nres; */ |
if(m != 1 && TKresult[nres]!= k1) |
k1= TKresult[nres]; |
continue; |
/* for(k1=1; k1<=m;k1++){ /\* For each combination of covariate *\/ */ |
|
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
jj1++; |
jj1++; |
if (cptcovn > 0) { |
if (cptcovn > 0) { |
fprintf(fichtm,"\n<li><a size=\"1\" color=\"#EC5E5E\" href=\"#rescov"); |
fprintf(fichtm,"\n<li><a size=\"1\" color=\"#EC5E5E\" href=\"#rescov"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ |
for (cpt=1; cpt<=cptcovs;cpt++){ /**< cptcovs number of SIMPLE covariates in the model V2+V1 =2 (dummy or quantit or time varying) */ |
fprintf(fichtm,"_V%d=%d_",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); |
fprintf(fichtm,"_V%d=%lg_",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
} |
|
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm,"_V%d=%f_",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
} |
} |
|
/* for (cpt=1; cpt<=cptcoveff;cpt++){ */ |
|
/* fprintf(fichtm,"_V%d=%d_",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); */ |
|
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(fichtm,"_V%d=%f_",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* } */ |
fprintf(fichtm,"\">"); |
fprintf(fichtm,"\">"); |
|
|
/* if(nqfveff+nqtveff 0) */ /* Test to be done */ |
/* if(nqfveff+nqtveff 0) */ /* Test to be done */ |
fprintf(fichtm,"************ Results for covariates"); |
fprintf(fichtm,"************ Results for covariates"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ |
for (cpt=1; cpt<=cptcovs;cpt++){ |
fprintf(fichtm," V%d=%d ",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); |
fprintf(fichtm," V%d=%lg ",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
} |
|
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
} |
} |
|
/* fprintf(fichtm,"************ Results for covariates"); */ |
|
/* for (cpt=1; cpt<=cptcoveff;cpt++){ */ |
|
/* fprintf(fichtm," V%d=%d ",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); */ |
|
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(fichtm," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* } */ |
if(invalidvarcomb[k1]){ |
if(invalidvarcomb[k1]){ |
fprintf(fichtm," Warning Combination (%d) ignored because no cases ",k1); |
fprintf(fichtm," Warning Combination (%d) ignored because no cases ",k1); |
continue; |
continue; |
Line 7558 void printinghtml(char fileresu[], char
|
Line 7622 void printinghtml(char fileresu[], char
|
|
|
jj1=0; |
jj1=0; |
|
|
for(nres=1; nres <= nresult; nres++) /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k1=1; k1<=m;k1++){ /* For each combination of covariate */ |
/* k1=nres; */ |
if(m != 1 && TKresult[nres]!= k1) |
k1= TKresult[nres]; |
continue; |
/* for(k1=1; k1<=m;k1++){ /\* For each combination of covariate *\/ */ |
|
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
|
|
/* for(i1=1; i1<=ncodemax[k1];i1++){ */ |
/* for(i1=1; i1<=ncodemax[k1];i1++){ */ |
jj1++; |
jj1++; |
if (cptcovn > 0) { |
if (cptcovn > 0) { |
fprintf(fichtm,"\n<p><a name=\"rescov"); |
fprintf(fichtm,"\n<p><a name=\"rescov"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ |
for (cpt=1; cpt<=cptcovs;cpt++){ |
fprintf(fichtm,"_V%d=%d_",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); |
fprintf(fichtm,"_V%d=%lg_",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
} |
|
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm,"_V%d=%f_",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
} |
} |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(fichtm,"_V%d=%f_",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* } */ |
fprintf(fichtm,"\"</a>"); |
fprintf(fichtm,"\"</a>"); |
|
|
fprintf(fichtm,"<hr size=\"2\" color=\"#EC5E5E\">************ Results for covariates"); |
fprintf(fichtm,"<hr size=\"2\" color=\"#EC5E5E\">************ Results for covariates"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ |
for (cpt=1; cpt<=cptcovs;cpt++){ |
fprintf(fichtm," V%d=%d ",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); |
fprintf(fichtm," V%d=%lg ",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
printf(" V%d=%d ",Tvresult[nres][cpt],Tresult[nres][cpt]);fflush(stdout); |
printf(" V%d=%lg ",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
/* fprintf(fichtm," V%d=%d ",Tvaraff[cpt],nbcode[Tvaraff[cpt]][codtabm(jj1,cpt)]); */ |
/* fprintf(fichtm," V%d=%d ",Tvaraff[cpt],nbcode[Tvaraff[cpt]][codtabm(jj1,cpt)]); */ |
/* printf(" V%d=%d ",Tvaraff[cpt],nbcode[Tvaraff[cpt]][codtabm(jj1,cpt)]);fflush(stdout); */ |
/* printf(" V%d=%d ",Tvaraff[cpt],nbcode[Tvaraff[cpt]][codtabm(jj1,cpt)]);fflush(stdout); */ |
} |
} |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);fflush(stdout); |
|
} |
|
|
|
/* if(nqfveff+nqtveff 0) */ /* Test to be done */ |
/* if(nqfveff+nqtveff 0) */ /* Test to be done */ |
fprintf(fichtm," (model=%s) ************\n<hr size=\"2\" color=\"#EC5E5E\">",model); |
fprintf(fichtm," (model=%s) ************\n<hr size=\"2\" color=\"#EC5E5E\">",model); |
if(invalidvarcomb[k1]){ |
if(invalidvarcomb[k1]){ |
Line 7661 with weights corresponding to observed p
|
Line 7722 with weights corresponding to observed p
|
fprintf(fichtm,"<img src=\"%s_%d-%d-%d.svg\">", subdirf2(optionfilefiname,"EXP_"),cpt,k1,nres ); |
fprintf(fichtm,"<img src=\"%s_%d-%d-%d.svg\">", subdirf2(optionfilefiname,"EXP_"),cpt,k1,nres ); |
} |
} |
/* } /\* end i1 *\/ */ |
/* } /\* end i1 *\/ */ |
}/* End k1 */ |
}/* End k1=nres */ |
fprintf(fichtm,"</ul>"); |
fprintf(fichtm,"</ul>"); |
|
|
fprintf(fichtm,"\ |
fprintf(fichtm,"\ |
Line 7719 See page 'Matrix of variance-covariance
|
Line 7780 See page 'Matrix of variance-covariance
|
jj1=0; |
jj1=0; |
|
|
fprintf(fichtm," \n<ul>"); |
fprintf(fichtm," \n<ul>"); |
for(nres=1; nres <= nresult; nres++) /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k1=1; k1<=m;k1++){ /* For each combination of covariate */ |
/* k1=nres; */ |
if(m != 1 && TKresult[nres]!= k1) |
k1= TKresult[nres]; |
continue; |
/* for(k1=1; k1<=m;k1++){ /\* For each combination of covariate *\/ */ |
|
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
jj1++; |
jj1++; |
if (cptcovn > 0) { |
if (cptcovn > 0) { |
fprintf(fichtm,"\n<li><a size=\"1\" color=\"#EC5E5E\" href=\"#rescovsecond"); |
fprintf(fichtm,"\n<li><a size=\"1\" color=\"#EC5E5E\" href=\"#rescovsecond"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ |
for (cpt=1; cpt<=cptcovs;cpt++){ |
fprintf(fichtm,"_V%d=%d_",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); |
fprintf(fichtm,"_V%d=%lg_",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
} |
|
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm,"_V%d=%f_",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
} |
} |
fprintf(fichtm,"\">"); |
fprintf(fichtm,"\">"); |
|
|
/* if(nqfveff+nqtveff 0) */ /* Test to be done */ |
/* if(nqfveff+nqtveff 0) */ /* Test to be done */ |
fprintf(fichtm,"************ Results for covariates"); |
fprintf(fichtm,"************ Results for covariates"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ |
for (cpt=1; cpt<=cptcovs;cpt++){ |
fprintf(fichtm," V%d=%d ",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); |
fprintf(fichtm," V%d=%lg ",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
} |
|
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
} |
} |
if(invalidvarcomb[k1]){ |
if(invalidvarcomb[k1]){ |
fprintf(fichtm," Warning Combination (%d) ignored because no cases ",k1); |
fprintf(fichtm," Warning Combination (%d) ignored because no cases ",k1); |
Line 7748 See page 'Matrix of variance-covariance
|
Line 7805 See page 'Matrix of variance-covariance
|
} |
} |
fprintf(fichtm,"</a></li>"); |
fprintf(fichtm,"</a></li>"); |
} /* cptcovn >0 */ |
} /* cptcovn >0 */ |
} |
} /* End nres */ |
fprintf(fichtm," \n</ul>"); |
fprintf(fichtm," \n</ul>"); |
|
|
jj1=0; |
jj1=0; |
|
|
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k1=1; k1<=m;k1++){ |
/* k1=nres; */ |
if(m != 1 && TKresult[nres]!= k1) |
k1= TKresult[nres]; |
continue; |
/* for(k1=1; k1<=m;k1++){ */ |
|
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
/* for(i1=1; i1<=ncodemax[k1];i1++){ */ |
/* for(i1=1; i1<=ncodemax[k1];i1++){ */ |
jj1++; |
jj1++; |
if (cptcovn > 0) { |
if (cptcovn > 0) { |
fprintf(fichtm,"\n<p><a name=\"rescovsecond"); |
fprintf(fichtm,"\n<p><a name=\"rescovsecond"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ |
for (cpt=1; cpt<=cptcovs;cpt++){ |
fprintf(fichtm,"_V%d=%d_",Tvresult[nres][cpt],(int)Tresult[nres][cpt]); |
fprintf(fichtm,"_V%d=%lg_",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
} |
|
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm,"_V%d=%f_",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
} |
} |
fprintf(fichtm,"\"</a>"); |
fprintf(fichtm,"\"</a>"); |
|
|
fprintf(fichtm,"<hr size=\"2\" color=\"#EC5E5E\">************ Results for covariates"); |
fprintf(fichtm,"<hr size=\"2\" color=\"#EC5E5E\">************ Results for covariates"); |
for (cpt=1; cpt<=cptcoveff;cpt++){ /**< cptcoveff number of variables */ |
for (cpt=1; cpt<=cptcovs;cpt++){ /**< cptcoveff number of variables */ |
fprintf(fichtm," V%d=%d ",Tvresult[nres][cpt],Tresult[nres][cpt]); |
fprintf(fichtm," V%d=%lg ",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
printf(" V%d=%d ",Tvresult[nres][cpt],Tresult[nres][cpt]);fflush(stdout); |
printf(" V%d=%lg ",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]); |
/* fprintf(fichtm," V%d=%d ",Tvaraff[cpt],nbcode[Tvaraff[cpt]][codtabm(jj1,cpt)]); */ |
/* fprintf(fichtm," V%d=%d ",Tvaraff[cpt],nbcode[Tvaraff[cpt]][codtabm(jj1,cpt)]); */ |
} |
} |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
|
fprintf(fichtm," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
|
} |
|
|
|
fprintf(fichtm," (model=%s) ************\n<hr size=\"2\" color=\"#EC5E5E\">",model); |
fprintf(fichtm," (model=%s) ************\n<hr size=\"2\" color=\"#EC5E5E\">",model); |
|
|
Line 7785 See page 'Matrix of variance-covariance
|
Line 7838 See page 'Matrix of variance-covariance
|
fprintf(fichtm,"\n<h4>Combination (%d) ignored because no cases </h4>\n",k1); |
fprintf(fichtm,"\n<h4>Combination (%d) ignored because no cases </h4>\n",k1); |
continue; |
continue; |
} |
} |
} |
} /* If cptcovn >0 */ |
for(cpt=1; cpt<=nlstate;cpt++) { |
for(cpt=1; cpt<=nlstate;cpt++) { |
fprintf(fichtm,"\n<br>- Observed (cross-sectional with mov_average=%d) and period (incidence based) \ |
fprintf(fichtm,"\n<br>- Observed (cross-sectional with mov_average=%d) and period (incidence based) \ |
prevalence (with 95%% confidence interval) in state (%d): <a href=\"%s_%d-%d-%d.svg\"> %s_%d-%d-%d.svg</a>",mobilav,cpt,subdirf2(optionfilefiname,"V_"),cpt,k1,nres,subdirf2(optionfilefiname,"V_"),cpt,k1,nres); |
prevalence (with 95%% confidence interval) in state (%d): <a href=\"%s_%d-%d-%d.svg\"> %s_%d-%d-%d.svg</a>",mobilav,cpt,subdirf2(optionfilefiname,"V_"),cpt,k1,nres,subdirf2(optionfilefiname,"V_"),cpt,k1,nres); |
Line 7800 true period expectancies (those weighted
|
Line 7853 true period expectancies (those weighted
|
fprintf(fichtm," (data from text file <a href=\"%s.txt\">%s.txt</a>) \n<br>",subdirf2(optionfilefiname,"T_"),subdirf2(optionfilefiname,"T_")); |
fprintf(fichtm," (data from text file <a href=\"%s.txt\">%s.txt</a>) \n<br>",subdirf2(optionfilefiname,"T_"),subdirf2(optionfilefiname,"T_")); |
fprintf(fichtm,"<img src=\"%s_%d-%d.svg\">",subdirf2(optionfilefiname,"E_"),k1,nres); |
fprintf(fichtm,"<img src=\"%s_%d-%d.svg\">",subdirf2(optionfilefiname,"E_"),k1,nres); |
/* } /\* end i1 *\/ */ |
/* } /\* end i1 *\/ */ |
}/* End k1 */ |
|
}/* End nres */ |
}/* End nres */ |
fprintf(fichtm,"</ul>"); |
fprintf(fichtm,"</ul>"); |
fflush(fichtm); |
fflush(fichtm); |
Line 7878 void printinggnuplot(char fileresu[], ch
|
Line 7930 void printinggnuplot(char fileresu[], ch
|
strcpy(optfileres,"vpl"); |
strcpy(optfileres,"vpl"); |
/* 1eme*/ |
/* 1eme*/ |
for (cpt=1; cpt<= nlstate ; cpt ++){ /* For each live state */ |
for (cpt=1; cpt<= nlstate ; cpt ++){ /* For each live state */ |
for (k1=1; k1<= m ; k1 ++){ /* For each valid combination of covariate */ |
/* for (k1=1; k1<= m ; k1 ++){ /\* For each valid combination of covariate *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
|
k1=TKresult[nres]; |
/* plot [100000000000000000000:-100000000000000000000] "mysbiaspar/vplrmysbiaspar.txt to check */ |
/* plot [100000000000000000000:-100000000000000000000] "mysbiaspar/vplrmysbiaspar.txt to check */ |
if(m != 1 && TKresult[nres]!= k1) |
/* if(m != 1 && TKresult[nres]!= k1) */ |
continue; |
/* continue; */ |
/* We are interested in selected combination by the resultline */ |
/* We are interested in selected combination by the resultline */ |
/* printf("\n# 1st: Period (stable) prevalence with CI: 'VPL_' files and live state =%d ", cpt); */ |
/* printf("\n# 1st: Period (stable) prevalence with CI: 'VPL_' files and live state =%d ", cpt); */ |
fprintf(ficgp,"\n# 1st: Forward (stable period) prevalence with CI: 'VPL_' files and live state =%d ", cpt); |
fprintf(ficgp,"\n# 1st: Forward (stable period) prevalence with CI: 'VPL_' files and live state =%d ", cpt); |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the value of the covariate corresponding to k1 combination *\/ */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
lv=codtabm(k1,TnsdVar[Tvaraff[k]]); |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
|
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate k get corresponding value lv for combination k1 *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the value of the covariate corresponding to k1 combination *\\/ *\/ */ |
vlv= nbcode[Tvaraff[k]][lv]; /* vlv is the value of the covariate lv, 0 or 1 */ |
/* lv=codtabm(k1,TnsdVar[Tvaraff[k]]); */ |
/* For each combination of covariate k1 (V1=1, V3=0), we printed the current covariate k and its value vlv */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
/* printf(" V%d=%d ",Tvaraff[k],vlv); */ |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* vlv= nbcode[Tvaraff[k]][lv]; /\* vlv is the value of the covariate lv, 0 or 1 *\/ */ |
} |
/* /\* For each combination of covariate k1 (V1=1, V3=0), we printed the current covariate k and its value vlv *\/ */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* /\* printf(" V%d=%d ",Tvaraff[k],vlv); *\/ */ |
/* printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* /\* printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
/* printf("\n#\n"); */ |
/* printf("\n#\n"); */ |
Line 8015 void printinggnuplot(char fileresu[], ch
|
Line 8072 void printinggnuplot(char fileresu[], ch
|
/* fprintf(ficgp,"\nset out ;unset label;\n"); */ |
/* fprintf(ficgp,"\nset out ;unset label;\n"); */ |
fprintf(ficgp,"\nset out ;unset title;\n"); |
fprintf(ficgp,"\nset out ;unset title;\n"); |
} /* nres */ |
} /* nres */ |
} /* k1 */ |
/* } /\* k1 *\/ */ |
} /* cpt */ |
} /* cpt */ |
|
|
|
|
/*2 eme*/ |
/*2 eme*/ |
for (k1=1; k1<= m ; k1 ++){ |
/* for (k1=1; k1<= m ; k1 ++){ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
fprintf(ficgp,"\n# 2nd: Total life expectancy with CI: 't' files "); |
fprintf(ficgp,"\n# 2nd: Total life expectancy with CI: 't' files "); |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate number corresponding to k1 combination *\/ */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
lv=codtabm(k1,TnsdVar[Tvaraff[k]]); |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate and each value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate number corresponding to k1 combination *\\/ *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* lv=codtabm(k1,TnsdVar[Tvaraff[k]]); */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
/* for(k=1; k <= ncovds; k++){ */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* } */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* /\* for(k=1; k <= ncovds; k++){ *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
Line 8083 void printinggnuplot(char fileresu[], ch
|
Line 8144 void printinggnuplot(char fileresu[], ch
|
} /* vpopbased */ |
} /* vpopbased */ |
fprintf(ficgp,"\nset out;set out \"%s_%d-%d.svg\"; replot; set out; unset label;\n",subdirf2(optionfilefiname,"E_"),k1,nres); /* Buggy gnuplot */ |
fprintf(ficgp,"\nset out;set out \"%s_%d-%d.svg\"; replot; set out; unset label;\n",subdirf2(optionfilefiname,"E_"),k1,nres); /* Buggy gnuplot */ |
} /* end nres */ |
} /* end nres */ |
} /* k1 end 2 eme*/ |
/* } /\* k1 end 2 eme*\/ */ |
|
|
|
|
/*3eme*/ |
/*3eme*/ |
for (k1=1; k1<= m ; k1 ++){ |
/* for (k1=1; k1<= m ; k1 ++){ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
|
|
for (cpt=1; cpt<= nlstate ; cpt ++) { /* Fragile no verification of covariate values */ |
for (cpt=1; cpt<= nlstate ; cpt ++) { /* Fragile no verification of covariate values */ |
fprintf(ficgp,"\n\n# 3d: Life expectancy with EXP_ files: combination=%d state=%d",k1, cpt); |
fprintf(ficgp,"\n\n# 3d: Life expectancy with EXP_ files: combination=%d state=%d",k1, cpt); |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate number corresponding to k1 combination *\/ */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /* Should be the covariate value corresponding to combination k1 and covariate k */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate and each value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate number corresponding to k1 combination *\\/ *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /\* Should be the covariate value corresponding to combination k1 and covariate k *\/ */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][resultmodel[nres][k4]]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][resultmodel[nres][k4]]); |
/* } */ |
} |
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
if(invalidvarcomb[k1]){ |
if(invalidvarcomb[k1]){ |
Line 8140 plot [%.f:%.f] \"%s\" every :::%d::%d u
|
Line 8205 plot [%.f:%.f] \"%s\" every :::%d::%d u
|
} |
} |
fprintf(ficgp,"\nunset label;\n"); |
fprintf(ficgp,"\nunset label;\n"); |
} /* end nres */ |
} /* end nres */ |
} /* end kl 3eme */ |
/* } /\* end kl 3eme *\/ */ |
|
|
/* 4eme */ |
/* 4eme */ |
/* Survival functions (period) from state i in state j by initial state i */ |
/* Survival functions (period) from state i in state j by initial state i */ |
for (k1=1; k1<=m; k1++){ /* For each covariate and each value */ |
/* for (k1=1; k1<=m; k1++){ /\* For each covariate and each value *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state cpt*/ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state cpt*/ |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
fprintf(ficgp,"\n#\n#\n# Survival functions in state j : 'LIJ_' files, cov=%d state=%d",k1, cpt); |
fprintf(ficgp,"\n#\n#\n# Survival functions in state %d : 'LIJ_' files, cov=%d state=%d", cpt, k1, cpt); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
lv=codtabm(k1,TnsdVar[Tvaraff[k]]); |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate number corresponding to k1 combination *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate and each value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* lv=codtabm(k1,TnsdVar[Tvaraff[k]]); */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate number corresponding to k1 combination *\\/ *\/ */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
Line 8193 set ter svg size 640, 480\nunset log y\n
|
Line 8262 set ter svg size 640, 480\nunset log y\n
|
fprintf(ficgp,"\nset out; unset label;\n"); |
fprintf(ficgp,"\nset out; unset label;\n"); |
} /* end cpt state*/ |
} /* end cpt state*/ |
} /* end nres */ |
} /* end nres */ |
} /* end covariate k1 */ |
/* } /\* end covariate k1 *\/ */ |
|
|
/* 5eme */ |
/* 5eme */ |
/* Survival functions (period) from state i in state j by final state j */ |
/* Survival functions (period) from state i in state j by final state j */ |
for (k1=1; k1<= m ; k1++){ /* For each covariate combination if any */ |
/* for (k1=1; k1<= m ; k1++){ /\* For each covariate combination if any *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each inital state */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each inital state */ |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
fprintf(ficgp,"\n#\n#\n# Survival functions in state j and all livestates from state i by final state j: 'lij' files, cov=%d state=%d",k1, cpt); |
fprintf(ficgp,"\n#\n#\n# Survival functions in state j and all livestates from state i by final state j: 'lij' files, cov=%d state=%d",k1, cpt); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
lv=codtabm(k1,TnsdVar[Tvaraff[k]]); |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate number corresponding to k1 combination *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate and each value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* lv=codtabm(k1,TnsdVar[Tvaraff[k]]); */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate number corresponding to k1 combination *\\/ *\/ */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
Line 8253 set ter svg size 640, 480\nunset log y\n
|
Line 8326 set ter svg size 640, 480\nunset log y\n
|
} |
} |
fprintf(ficgp,"\nset out; unset label;\n"); |
fprintf(ficgp,"\nset out; unset label;\n"); |
} /* end cpt state*/ |
} /* end cpt state*/ |
} /* end covariate */ |
/* } /\* end covariate *\/ */ |
} /* end nres */ |
} /* end nres */ |
|
|
/* 6eme */ |
/* 6eme */ |
/* CV preval stable (period) for each covariate */ |
/* CV preval stable (period) for each covariate */ |
for (k1=1; k1<= m ; k1 ++) /* For each covariate combination if any */ |
/* for (k1=1; k1<= m ; k1 ++) /\* For each covariate combination if any *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state of arrival */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state of arrival */ |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
fprintf(ficgp,"\n#\n#\n#CV preval stable (forward): 'pij' files, covariatecombination#=%d state=%d",k1, cpt); |
fprintf(ficgp,"\n#\n#\n#CV preval stable (forward): 'pij' files, covariatecombination#=%d state=%d",k1, cpt); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate number corresponding to k1 combination *\/ */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
lv=codtabm(k1,TnsdVar[Tvaraff[k]]); |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate and each value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate number corresponding to k1 combination *\\/ *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* lv=codtabm(k1,TnsdVar[Tvaraff[k]]); */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
Line 8311 set ter svg size 640, 480\nunset log y\n
|
Line 8388 set ter svg size 640, 480\nunset log y\n
|
/* 7eme */ |
/* 7eme */ |
if(prevbcast == 1){ |
if(prevbcast == 1){ |
/* CV backward prevalence for each covariate */ |
/* CV backward prevalence for each covariate */ |
for (k1=1; k1<= m ; k1 ++) /* For each covariate combination if any */ |
/* for (k1=1; k1<= m ; k1 ++) /\* For each covariate combination if any *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life origin state */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life origin state */ |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
fprintf(ficgp,"\n#\n#\n#CV Backward stable prevalence: 'pijb' files, covariatecombination#=%d state=%d",k1, cpt); |
fprintf(ficgp,"\n#\n#\n#CV Backward stable prevalence: 'pijb' files, covariatecombination#=%d state=%d",k1, cpt); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate number corresponding to k1 combination *\/ */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
lv=codtabm(k1,TnsdVar[Tvaraff[k]]); |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate and each value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate number corresponding to k1 combination *\\/ *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* lv=codtabm(k1,TnsdVar[Tvaraff[k]]); */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
Line 8369 set ter svg size 640, 480\nunset log y\n
|
Line 8450 set ter svg size 640, 480\nunset log y\n
|
if(prevfcast==1){ |
if(prevfcast==1){ |
/* Projection from cross-sectional to forward stable (period) prevalence for each covariate */ |
/* Projection from cross-sectional to forward stable (period) prevalence for each covariate */ |
|
|
for (k1=1; k1<= m ; k1 ++) /* For each covariate combination if any */ |
/* for (k1=1; k1<= m ; k1 ++) /\* For each covariate combination if any *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state */ |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
fprintf(ficgp,"\n#\n#\n#Projection of prevalence to forward stable prevalence (period): 'PROJ_' files, covariatecombination#=%d state=%d",k1, cpt); |
fprintf(ficgp,"\n#\n#\n#Projection of prevalence to forward stable prevalence (period): 'PROJ_' files, covariatecombination#=%d state=%d",k1, cpt); |
for (k=1; k<=cptcoveff; k++){ /* For each correspondig covariate value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate value corresponding to k1 combination and kth covariate *\/ */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
lv=codtabm(k1,TnsdVar[Tvaraff[k]]); |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each correspondig covariate value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate value corresponding to k1 combination and kth covariate *\\/ *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* lv=codtabm(k1,TnsdVar[Tvaraff[k]]); */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
Line 8486 set ter svg size 640, 480\nunset log y\n
|
Line 8571 set ter svg size 640, 480\nunset log y\n
|
if(prevbcast==1){ |
if(prevbcast==1){ |
/* Back projection from cross-sectional to stable (mixed) for each covariate */ |
/* Back projection from cross-sectional to stable (mixed) for each covariate */ |
|
|
for (k1=1; k1<= m ; k1 ++) /* For each covariate combination if any */ |
/* for (k1=1; k1<= m ; k1 ++) /\* For each covariate combination if any *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
k1=TKresult[nres]; |
continue; |
/* if(m != 1 && TKresult[nres]!= k1) */ |
|
/* continue; */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state */ |
for (cpt=1; cpt<=nlstate ; cpt ++) { /* For each life state */ |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
fprintf(ficgp,"\n#\n#\n#Back projection of prevalence to stable (mixed) back prevalence: 'BPROJ_' files, covariatecombination#=%d originstate=%d",k1, cpt); |
fprintf(ficgp,"\n#\n#\n#Back projection of prevalence to stable (mixed) back prevalence: 'BPROJ_' files, covariatecombination#=%d originstate=%d",k1, cpt); |
for (k=1; k<=cptcoveff; k++){ /* For each correspondig covariate value */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate value corresponding to k1 combination and kth covariate *\/ */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /* Should be the covariate value corresponding to combination k1 and covariate k */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each correspondig covariate value *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate value corresponding to k1 combination and kth covariate *\\/ *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
/* lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /\* Should be the covariate value corresponding to combination k1 and covariate k *\/ */ |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
} |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
} |
} |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
Line 8561 set ter svg size 640, 480\nunset log y\n
|
Line 8650 set ter svg size 640, 480\nunset log y\n
|
fprintf(ficgp," u %d:(",ioffset); |
fprintf(ficgp," u %d:(",ioffset); |
kl=0; |
kl=0; |
strcpy(gplotcondition,"("); |
strcpy(gplotcondition,"("); |
for (k=1; k<=cptcoveff; k++){ /* For each covariate writing the chain of conditions */ |
for (k=1; k<=cptcovs; k++){ /* For each covariate k of the resultline, get corresponding value lv for combination k1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate value corresponding to combination k1 and covariate k *\/ */ |
if(Dummy[Tvresult[nres][k]]==0){ /* To be verified */ |
lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /* Should be the covariate value corresponding to combination k1 and covariate k */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each covariate writing the chain of conditions *\/ */ |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate value corresponding to combination k1 and covariate k *\/ */ |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
/* lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /\* Should be the covariate value corresponding to combination k1 and covariate k *\/ */ |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
lv=Tvresult[nres][k]; |
/* vlv= nbcode[Tvaraff[k]][lv]; /\* Value of the modality of Tvaraff[k] *\/ */ |
vlv=TinvDoQresult[nres][Tvresult[nres][k]]; |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
kl++; |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%d " ,kl,Tvaraff[k], kl+1, nbcode[Tvaraff[k]][lv]); |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
kl++; |
/* vlv= nbcode[Tvaraff[k]][lv]; /\* Value of the modality of Tvaraff[k] *\/ */ |
if(k <cptcoveff && cptcoveff>1) |
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
sprintf(gplotcondition+strlen(gplotcondition)," && "); |
kl++; |
|
/* sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%d " ,kl,Tvaraff[k], kl+1, nbcode[Tvaraff[k]][lv]); */ |
|
sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%lg " ,kl,Tvresult[nres][k], kl+1,TinvDoQresult[nres][Tvresult[nres][k]]); |
|
kl++; |
|
if(k <cptcoveff && cptcoveff>1) |
|
sprintf(gplotcondition+strlen(gplotcondition)," && "); |
|
} |
} |
} |
strcpy(gplotcondition+strlen(gplotcondition),")"); |
strcpy(gplotcondition+strlen(gplotcondition),")"); |
/* kl=6+(cpt-1)*(nlstate+1)+1+(i-1); /\* 6+(1-1)*(2+1)+1+(1-1)=7, 6+(2-1)(2+1)+1+(1-1)=10 *\/ */ |
/* kl=6+(cpt-1)*(nlstate+1)+1+(i-1); /\* 6+(1-1)*(2+1)+1+(1-1)=7, 6+(2-1)(2+1)+1+(1-1)=10 *\/ */ |
Line 8641 set ter svg size 640, 480\nunset log y\n
|
Line 8736 set ter svg size 640, 480\nunset log y\n
|
fprintf(ficgp,"#model=%s \n",model); |
fprintf(ficgp,"#model=%s \n",model); |
fprintf(ficgp,"# Type of graphic ng=%d\n",ng); |
fprintf(ficgp,"# Type of graphic ng=%d\n",ng); |
fprintf(ficgp,"# k1=1 to 2^%d=%d\n",cptcoveff,m);/* to be checked */ |
fprintf(ficgp,"# k1=1 to 2^%d=%d\n",cptcoveff,m);/* to be checked */ |
for(k1=1; k1 <=m; k1++) /* For each combination of covariate */ |
/* for(k1=1; k1 <=m; k1++) /\* For each combination of covariate *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(m != 1 && TKresult[nres]!= k1) |
/* k1=nres; */ |
continue; |
k1= TKresult[nres]; |
fprintf(ficgp,"\n\n# Combination of dummy k1=%d which is ",k1); |
fprintf(ficgp,"\n\n# Resultline k1=%d ",k1); |
strcpy(gplotlabel,"("); |
strcpy(gplotlabel,"("); |
/*sprintf(gplotlabel+strlen(gplotlabel)," Dummy combination %d ",k1);*/ |
/*sprintf(gplotlabel+strlen(gplotlabel)," Dummy combination %d ",k1);*/ |
for (k=1; k<=cptcoveff; k++){ /* For each correspondig covariate value */ |
for (k=1; k<=cptcovs; k++){ /**< cptcovs number of SIMPLE covariates in the model V2+V1 =2 (dummy or quantit or time varying) */ |
/* lv= decodtabm(k1,k,cptcoveff); /\* Should be the covariate value corresponding to k1 combination and kth covariate *\/ */ |
/* for each resultline nres, and position k, Tvresult[nres][k] gives the name of the variable and |
lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /* Should be the covariate value corresponding to combination k1 and covariate k */ |
TinvDoQresult[nres][Tvresult[nres][k]] gives its value double or integer) */ |
/* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ |
fprintf(ficgp," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%lg ",Tvresult[nres][k],TinvDoQresult[nres][Tvresult[nres][k]]); |
/* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 */ |
} |
/* vlv= nbcode[Tvaraff[k]][lv]; */ |
/* if(m != 1 && TKresult[nres]!= k1) */ |
vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; |
/* continue; */ |
fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); |
/* fprintf(ficgp,"\n\n# Combination of dummy k1=%d which is ",k1); */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); |
/* strcpy(gplotlabel,"("); */ |
} |
/* /\*sprintf(gplotlabel+strlen(gplotlabel)," Dummy combination %d ",k1);*\/ */ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
/* for (k=1; k<=cptcoveff; k++){ /\* For each correspondig covariate value *\/ */ |
fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* /\* lv= decodtabm(k1,k,cptcoveff); /\\* Should be the covariate value corresponding to k1 combination and kth covariate *\\/ *\/ */ |
sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); |
/* lv= codtabm(k1,TnsdVar[Tvaraff[k]]); /\* Should be the covariate value corresponding to combination k1 and covariate k *\/ */ |
} |
/* /\* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 *\/ */ |
|
/* /\* decodtabm(1,2,4) = 1 because h=1 k= 1 (1) 1 1 *\/ */ |
|
/* /\* decodtabm(13,3,4)= 2 because h=13 k= 1 1 (2) 2 *\/ */ |
|
/* /\* vlv= nbcode[Tvaraff[k]][lv]; *\/ */ |
|
/* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ |
|
/* fprintf(ficgp," V%d=%d ",Tvaraff[k],vlv); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%d ",Tvaraff[k],vlv); */ |
|
/* } */ |
|
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* fprintf(ficgp," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* sprintf(gplotlabel+strlen(gplotlabel)," V%d=%f ",Tvqresult[nres][resultmodel[nres][k4]],Tqresult[nres][resultmodel[nres][k4]]); */ |
|
/* } */ |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
strcpy(gplotlabel+strlen(gplotlabel),")"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\n#\n"); |
fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" ",subdirf2(optionfilefiname,"PE_"),k1,ng,nres); |
fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" ",subdirf2(optionfilefiname,"PE_"),k1,ng,nres); |
Line 8878 set ter svg size 640, 480\nunset log y\n
|
Line 8984 set ter svg size 640, 480\nunset log y\n
|
} /* end k2 */ |
} /* end k2 */ |
/* fprintf(ficgp,"\n set out; unset label;set key default;\n"); */ |
/* fprintf(ficgp,"\n set out; unset label;set key default;\n"); */ |
fprintf(ficgp,"\n set out; unset title;set key default;\n"); |
fprintf(ficgp,"\n set out; unset title;set key default;\n"); |
} /* end k1 */ |
} /* end resultline */ |
} /* end ng */ |
} /* end ng */ |
/* avoid: */ |
/* avoid: */ |
fflush(ficgp); |
fflush(ficgp); |
Line 9447 void prevforecast(char fileres[], double
|
Line 9553 void prevforecast(char fileres[], double
|
i1=pow(2,cptcoveff); |
i1=pow(2,cptcoveff); |
if (cptcovn < 1){i1=1;} |
if (cptcovn < 1){i1=1;} |
|
|
for(nres=1; nres <= nresult; nres++) /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k=1; k<=i1;k++){ /* We find the combination equivalent to result line values of dummies */ |
k=TKresult[nres]; |
|
/* for(k=1; k<=i1;k++){ /\* We find the combination equivalent to result line values of dummies *\/ */ |
if(i1 != 1 && TKresult[nres]!= k) |
if(i1 != 1 && TKresult[nres]!= k) |
continue; |
continue; |
fprintf(ficresvpl,"\n#****** "); |
fprintf(ficresvpl,"\n#****** "); |
printf("\n#****** "); |
printf("\n#****** "); |
fprintf(ficlog,"\n#****** "); |
fprintf(ficlog,"\n#****** "); |
for(j=1;j<=cptcoveff;j++) { |
for(j=1;j<=cptcovs;j++) { |
fprintf(ficresvpl,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
fprintf(ficresvpl,"V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
fprintf(ficlog,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
fprintf(ficlog,"V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
printf("V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
printf("V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
|
/* fprintf(ficlog,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
|
/* printf("V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
} |
} |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ |
/* for (j=1; j<= nsq; j++){ /\* For each selected (single) quantitative value *\/ */ |
printf(" V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* printf(" V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
fprintf(ficresvpl," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* fprintf(ficresvpl," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
fprintf(ficlog," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* fprintf(ficlog," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
} |
/* } */ |
fprintf(ficresvpl,"******\n"); |
fprintf(ficresvpl,"******\n"); |
printf("******\n"); |
printf("******\n"); |
fprintf(ficlog,"******\n"); |
fprintf(ficlog,"******\n"); |
Line 9504 void prevforecast(char fileres[], double
|
Line 9613 void prevforecast(char fileres[], double
|
i1=pow(2,cptcoveff); |
i1=pow(2,cptcoveff); |
if (cptcovn < 1){i1=1;} |
if (cptcovn < 1){i1=1;} |
|
|
for(nres=1; nres <= nresult; nres++) /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k=1; k<=i1;k++){ |
k=TKresult[nres]; |
if(i1 != 1 && TKresult[nres]!= k) |
/* for(k=1; k<=i1;k++){ */ |
continue; |
/* if(i1 != 1 && TKresult[nres]!= k) */ |
|
/* continue; */ |
fprintf(ficresvbl,"\n#****** "); |
fprintf(ficresvbl,"\n#****** "); |
printf("\n#****** "); |
printf("\n#****** "); |
fprintf(ficlog,"\n#****** "); |
fprintf(ficlog,"\n#****** "); |
for(j=1;j<=cptcoveff;j++) { |
for (j=1; j<= cptcovs; j++){ /* For each selected (single) quantitative value */ |
fprintf(ficresvbl,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
printf(" V%d=%lg ",Tvqresult[nres][j],TinvDoQresult[nres][resultmodel[nres][j]]); |
fprintf(ficlog,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
fprintf(ficresvbl," V%d=%lg ",Tvqresult[nres][j],TinvDoQresult[nres][resultmodel[nres][j]]); |
printf("V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
fprintf(ficlog," V%d=%lg ",Tvqresult[nres][j],TinvDoQresult[nres][resultmodel[nres][j]]); |
} |
/* for(j=1;j<=cptcoveff;j++) { */ |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficresvbl,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
printf(" V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* fprintf(ficlog,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
fprintf(ficresvbl," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* printf("V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
fprintf(ficlog," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* } */ |
|
/* for (j=1; j<= nsq; j++){ /\* For each selected (single) quantitative value *\/ */ |
|
/* printf(" V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
|
/* fprintf(ficresvbl," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
|
/* fprintf(ficlog," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
} |
} |
fprintf(ficresvbl,"******\n"); |
fprintf(ficresvbl,"******\n"); |
printf("******\n"); |
printf("******\n"); |
Line 11436 int prevalence_limit(double *p, double *
|
Line 11550 int prevalence_limit(double *p, double *
|
i1=pow(2,cptcoveff); /* Number of combination of dummy covariates */ |
i1=pow(2,cptcoveff); /* Number of combination of dummy covariates */ |
if (cptcovn < 1){i1=1;} |
if (cptcovn < 1){i1=1;} |
|
|
for(k=1; k<=i1;k++){ /* For each combination k of dummy covariates in the model */ |
/* for(k=1; k<=i1;k++){ /\* For each combination k of dummy covariates in the model *\/ */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
if(i1 != 1 && TKresult[nres]!= k) |
k=TKresult[nres]; |
continue; |
/* if(i1 != 1 && TKresult[nres]!= k) /\* We found the combination k corresponding to the resultline value of dummies *\/ */ |
|
/* continue; */ |
|
|
/* for(cptcov=1,k=0;cptcov<=i1;cptcov++){ */ |
/* for(cptcov=1,k=0;cptcov<=i1;cptcov++){ */ |
/* for(cptcov=1,k=0;cptcov<=1;cptcov++){ */ |
/* for(cptcov=1,k=0;cptcov<=1;cptcov++){ */ |
Line 11450 int prevalence_limit(double *p, double *
|
Line 11565 int prevalence_limit(double *p, double *
|
fprintf(ficrespl,"#******"); |
fprintf(ficrespl,"#******"); |
printf("#******"); |
printf("#******"); |
fprintf(ficlog,"#******"); |
fprintf(ficlog,"#******"); |
for(j=1;j<=cptcoveff ;j++) {/* all covariates */ |
for(j=1;j<=cptcovs ;j++) {/**< cptcovs number of SIMPLE covariates in the model or resultline V2+V1 =2 (dummy or quantit or time varying) */ |
/* fprintf(ficrespl," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,Tvaraff[j])]); /\* Here problem for varying dummy*\/ */ |
/* fprintf(ficrespl," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,Tvaraff[j])]); /\* Here problem for varying dummy*\/ */ |
fprintf(ficrespl," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); /* Here problem for varying dummy*/ |
/* printf(" V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
printf(" V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
/* fprintf(ficlog," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
fprintf(ficlog," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
fprintf(ficrespl," V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
} |
printf(" V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
fprintf(ficlog," V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
} |
fprintf(ficrespl," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
fprintf(ficlog," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
} |
/* fprintf(ficrespl," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* fprintf(ficlog," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
/* } */ |
fprintf(ficrespl,"******\n"); |
fprintf(ficrespl,"******\n"); |
printf("******\n"); |
printf("******\n"); |
fprintf(ficlog,"******\n"); |
fprintf(ficlog,"******\n"); |
Line 11472 int prevalence_limit(double *p, double *
|
Line 11589 int prevalence_limit(double *p, double *
|
} |
} |
|
|
fprintf(ficrespl,"#Age "); |
fprintf(ficrespl,"#Age "); |
for(j=1;j<=cptcoveff;j++) { |
/* for(j=1;j<=cptcoveff;j++) { */ |
fprintf(ficrespl,"V%d %d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
/* fprintf(ficrespl,"V%d %d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
|
/* } */ |
|
for(j=1;j<=cptcovs;j++) { /* New the quanti variable is added */ |
|
fprintf(ficrespl,"V%d %lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
} |
} |
for(i=1; i<=nlstate;i++) fprintf(ficrespl," %d-%d ",i,i); |
for(i=1; i<=nlstate;i++) fprintf(ficrespl," %d-%d ",i,i); |
fprintf(ficrespl,"Total Years_to_converge\n"); |
fprintf(ficrespl,"Total Years_to_converge\n"); |
|
|
for (age=agebase; age<=agelim; age++){ |
for (age=agebase; age<=agelim; age++){ |
/* for (age=agebase; age<=agebase; age++){ */ |
/* for (age=agebase; age<=agebase; age++){ */ |
prevalim(prlim, nlstate, p, age, oldm, savm, ftolpl, ncvyearp, k, nres); |
/**< Computes the prevalence limit in each live state at age x and for covariate combination (k and) nres */ |
|
prevalim(prlim, nlstate, p, age, oldm, savm, ftolpl, ncvyearp, k, nres); /* Nicely done */ |
fprintf(ficrespl,"%.0f ",age ); |
fprintf(ficrespl,"%.0f ",age ); |
for(j=1;j<=cptcoveff;j++) |
/* for(j=1;j<=cptcoveff;j++) */ |
fprintf(ficrespl,"%d %d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
/* fprintf(ficrespl,"%d %d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
|
for(j=1;j<=cptcovs;j++) |
|
fprintf(ficrespl,"%d %lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
tot=0.; |
tot=0.; |
for(i=1; i<=nlstate;i++){ |
for(i=1; i<=nlstate;i++){ |
tot += prlim[i][i]; |
tot += prlim[i][i]; |
Line 11492 int prevalence_limit(double *p, double *
|
Line 11615 int prevalence_limit(double *p, double *
|
fprintf(ficrespl," %.3f %d\n", tot, *ncvyearp); |
fprintf(ficrespl," %.3f %d\n", tot, *ncvyearp); |
} /* Age */ |
} /* Age */ |
/* was end of cptcod */ |
/* was end of cptcod */ |
} /* cptcov */ |
} /* nres */ |
} /* nres */ |
/* } /\* for each combination *\/ */ |
return 0; |
return 0; |
} |
} |
|
|
Line 11608 int back_prevalence_limit(double *p, dou
|
Line 11731 int back_prevalence_limit(double *p, dou
|
|
|
int hPijx(double *p, int bage, int fage){ |
int hPijx(double *p, int bage, int fage){ |
/*------------- h Pij x at various ages ------------*/ |
/*------------- h Pij x at various ages ------------*/ |
|
/* to be optimized with precov */ |
int stepsize; |
int stepsize; |
int agelim; |
int agelim; |
int hstepm; |
int hstepm; |
Line 11618 int hPijx(double *p, int bage, int fage)
|
Line 11741 int hPijx(double *p, int bage, int fage)
|
double agedeb; |
double agedeb; |
double ***p3mat; |
double ***p3mat; |
|
|
strcpy(filerespij,"PIJ_"); strcat(filerespij,fileresu); |
strcpy(filerespij,"PIJ_"); strcat(filerespij,fileresu); |
if((ficrespij=fopen(filerespij,"w"))==NULL) { |
if((ficrespij=fopen(filerespij,"w"))==NULL) { |
printf("Problem with Pij resultfile: %s\n", filerespij); return 1; |
printf("Problem with Pij resultfile: %s\n", filerespij); return 1; |
fprintf(ficlog,"Problem with Pij resultfile: %s\n", filerespij); return 1; |
fprintf(ficlog,"Problem with Pij resultfile: %s\n", filerespij); return 1; |
} |
} |
printf("Computing pij: result on file '%s' \n", filerespij); |
printf("Computing pij: result on file '%s' \n", filerespij); |
fprintf(ficlog,"Computing pij: result on file '%s' \n", filerespij); |
fprintf(ficlog,"Computing pij: result on file '%s' \n", filerespij); |
|
|
stepsize=(int) (stepm+YEARM-1)/YEARM; |
stepsize=(int) (stepm+YEARM-1)/YEARM; |
/*if (stepm<=24) stepsize=2;*/ |
/*if (stepm<=24) stepsize=2;*/ |
|
|
agelim=AGESUP; |
agelim=AGESUP; |
hstepm=stepsize*YEARM; /* Every year of age */ |
hstepm=stepsize*YEARM; /* Every year of age */ |
hstepm=hstepm/stepm; /* Typically 2 years, = 2/6 months = 4 */ |
hstepm=hstepm/stepm; /* Typically 2 years, = 2/6 months = 4 */ |
|
|
/* hstepm=1; aff par mois*/ |
/* hstepm=1; aff par mois*/ |
pstamp(ficrespij); |
pstamp(ficrespij); |
fprintf(ficrespij,"#****** h Pij x Probability to be in state j at age x+h being in i at x "); |
fprintf(ficrespij,"#****** h Pij x Probability to be in state j at age x+h being in i at x "); |
i1= pow(2,cptcoveff); |
i1= pow(2,cptcoveff); |
/* for(cptcov=1,k=0;cptcov<=i1;cptcov++){ */ |
/* for(cptcov=1,k=0;cptcov<=i1;cptcov++){ */ |
/* /\*for(cptcod=1;cptcod<=ncodemax[cptcov];cptcod++){*\/ */ |
/* /\*for(cptcod=1;cptcod<=ncodemax[cptcov];cptcod++){*\/ */ |
/* k=k+1; */ |
/* k=k+1; */ |
for(nres=1; nres <= nresult; nres++) /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k=1; k<=i1;k++){ |
k=TKresult[nres]; |
if(i1 != 1 && TKresult[nres]!= k) |
/* for(k=1; k<=i1;k++){ */ |
continue; |
/* if(i1 != 1 && TKresult[nres]!= k) */ |
fprintf(ficrespij,"\n#****** "); |
/* continue; */ |
for(j=1;j<=cptcoveff;j++) |
fprintf(ficrespij,"\n#****** "); |
fprintf(ficrespij,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
for(j=1;j<=cptcovs;j++){ |
for (k4=1; k4<= nsq; k4++){ /* For each selected (single) quantitative value */ |
fprintf(ficrespij," V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* fprintf(ficrespij,"@wV%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
fprintf(ficrespij," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); |
/* for (k4=1; k4<= nsq; k4++){ /\* For each selected (single) quantitative value *\/ */ |
} |
/* printf(" V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
fprintf(ficrespij,"******\n"); |
/* fprintf(ficrespij," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]); */ |
|
} |
for (agedeb=fage; agedeb>=bage; agedeb--){ /* If stepm=6 months */ |
fprintf(ficrespij,"******\n"); |
nhstepm=(int) rint((agelim-agedeb)*YEARM/stepm); /* Typically 20 years = 20*12/6=40 */ |
|
nhstepm = nhstepm/hstepm; /* Typically 40/4=10 */ |
for (agedeb=fage; agedeb>=bage; agedeb--){ /* If stepm=6 months */ |
|
nhstepm=(int) rint((agelim-agedeb)*YEARM/stepm); /* Typically 20 years = 20*12/6=40 */ |
/* nhstepm=nhstepm*YEARM; aff par mois*/ |
nhstepm = nhstepm/hstepm; /* Typically 40/4=10 */ |
|
|
p3mat=ma3x(1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); |
/* nhstepm=nhstepm*YEARM; aff par mois*/ |
oldm=oldms;savm=savms; |
|
hpxij(p3mat,nhstepm,agedeb,hstepm,p,nlstate,stepm,oldm,savm, k, nres); |
p3mat=ma3x(1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); |
fprintf(ficrespij,"# Cov Agex agex+h hpijx with i,j="); |
oldm=oldms;savm=savms; |
|
hpxij(p3mat,nhstepm,agedeb,hstepm,p,nlstate,stepm,oldm,savm, k, nres); |
|
fprintf(ficrespij,"# Cov Agex agex+h hpijx with i,j="); |
|
for(i=1; i<=nlstate;i++) |
|
for(j=1; j<=nlstate+ndeath;j++) |
|
fprintf(ficrespij," %1d-%1d",i,j); |
|
fprintf(ficrespij,"\n"); |
|
for (h=0; h<=nhstepm; h++){ |
|
/*agedebphstep = agedeb + h*hstepm/YEARM*stepm;*/ |
|
fprintf(ficrespij,"%d %3.f %3.f",k, agedeb, agedeb + h*hstepm/YEARM*stepm ); |
for(i=1; i<=nlstate;i++) |
for(i=1; i<=nlstate;i++) |
for(j=1; j<=nlstate+ndeath;j++) |
for(j=1; j<=nlstate+ndeath;j++) |
fprintf(ficrespij," %1d-%1d",i,j); |
fprintf(ficrespij," %.5f", p3mat[i][j][h]); |
fprintf(ficrespij,"\n"); |
|
for (h=0; h<=nhstepm; h++){ |
|
/*agedebphstep = agedeb + h*hstepm/YEARM*stepm;*/ |
|
fprintf(ficrespij,"%d %3.f %3.f",k, agedeb, agedeb + h*hstepm/YEARM*stepm ); |
|
for(i=1; i<=nlstate;i++) |
|
for(j=1; j<=nlstate+ndeath;j++) |
|
fprintf(ficrespij," %.5f", p3mat[i][j][h]); |
|
fprintf(ficrespij,"\n"); |
|
} |
|
free_ma3x(p3mat,1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); |
|
fprintf(ficrespij,"\n"); |
fprintf(ficrespij,"\n"); |
} |
} |
/*}*/ |
free_ma3x(p3mat,1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); |
|
fprintf(ficrespij,"\n"); |
} |
} |
return 0; |
} |
|
/*}*/ |
|
return 0; |
} |
} |
|
|
int hBijx(double *p, int bage, int fage, double ***prevacurrent){ |
int hBijx(double *p, int bage, int fage, double ***prevacurrent){ |
/*------------- h Bij x at various ages ------------*/ |
/*------------- h Bij x at various ages ------------*/ |
|
/* To be optimized with precov */ |
int stepsize; |
int stepsize; |
/* int agelim; */ |
/* int agelim; */ |
int ageminl; |
int ageminl; |
Line 11720 int hPijx(double *p, int bage, int fage)
|
Line 11845 int hPijx(double *p, int bage, int fage)
|
/* /\*for(cptcod=1;cptcod<=ncodemax[cptcov];cptcod++){*\/ */ |
/* /\*for(cptcod=1;cptcod<=ncodemax[cptcov];cptcod++){*\/ */ |
/* k=k+1; */ |
/* k=k+1; */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(nres=1; nres <= nresult; nres++){ /* For each resultline */ |
for(k=1; k<=i1;k++){ /* For any combination of dummy covariates, fixed and varying */ |
k=TKresult[nres]; |
if(i1 != 1 && TKresult[nres]!= k) |
/* for(k=1; k<=i1;k++){ /\* For any combination of dummy covariates, fixed and varying *\/ */ |
continue; |
/* if(i1 != 1 && TKresult[nres]!= k) */ |
fprintf(ficrespijb,"\n#****** "); |
/* continue; */ |
for(j=1;j<=cptcoveff;j++) |
fprintf(ficrespijb,"\n#****** "); |
fprintf(ficrespijb,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
for(j=1;j<=cptcovs;j++){ |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ |
fprintf(ficrespij," V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][Tvresult[nres][j]]); |
fprintf(ficrespijb," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); |
/* for(j=1;j<=cptcoveff;j++) */ |
} |
/* fprintf(ficrespijb,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
fprintf(ficrespijb,"******\n"); |
/* for (j=1; j<= nsq; j++){ /\* For each selected (single) quantitative value *\/ */ |
if(invalidvarcomb[k]){ /* Is it necessary here? */ |
/* fprintf(ficrespijb," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); */ |
fprintf(ficrespijb,"\n#Combination (%d) ignored because no cases \n",k); |
} |
continue; |
fprintf(ficrespijb,"******\n"); |
} |
if(invalidvarcomb[k]){ /* Is it necessary here? */ |
|
fprintf(ficrespijb,"\n#Combination (%d) ignored because no cases \n",k); |
/* for (agedeb=fage; agedeb>=bage; agedeb--){ /\* If stepm=6 months *\/ */ |
continue; |
for (agedeb=bage; agedeb<=fage; agedeb++){ /* If stepm=6 months and estepm=24 (2 years) */ |
} |
/* nhstepm=(int) rint((agelim-agedeb)*YEARM/stepm); /\* Typically 20 years = 20*12/6=40 *\/ */ |
|
nhstepm=(int) rint((agedeb-ageminl)*YEARM/stepm+0.1)-1; /* Typically 20 years = 20*12/6=40 or 55*12/24=27.5-1.1=>27 */ |
/* for (agedeb=fage; agedeb>=bage; agedeb--){ /\* If stepm=6 months *\/ */ |
nhstepm = nhstepm/hstepm; /* Typically 40/4=10, because estepm=24 stepm=6 => hstepm=24/6=4 or 28*/ |
for (agedeb=bage; agedeb<=fage; agedeb++){ /* If stepm=6 months and estepm=24 (2 years) */ |
|
/* nhstepm=(int) rint((agelim-agedeb)*YEARM/stepm); /\* Typically 20 years = 20*12/6=40 *\/ */ |
/* nhstepm=nhstepm*YEARM; aff par mois*/ |
nhstepm=(int) rint((agedeb-ageminl)*YEARM/stepm+0.1)-1; /* Typically 20 years = 20*12/6=40 or 55*12/24=27.5-1.1=>27 */ |
|
nhstepm = nhstepm/hstepm; /* Typically 40/4=10, because estepm=24 stepm=6 => hstepm=24/6=4 or 28*/ |
p3mat=ma3x(1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); /* We can't have it at an upper level because of nhstepm */ |
|
/* and memory limitations if stepm is small */ |
/* nhstepm=nhstepm*YEARM; aff par mois*/ |
|
|
/* oldm=oldms;savm=savms; */ |
p3mat=ma3x(1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); /* We can't have it at an upper level because of nhstepm */ |
/* hbxij(p3mat,nhstepm,agedeb,hstepm,p,nlstate,stepm,oldm,savm, k); */ |
/* and memory limitations if stepm is small */ |
hbxij(p3mat,nhstepm,agedeb,hstepm,p,prevacurrent,nlstate,stepm, k, nres);/* Bug valgrind */ |
|
/* hbxij(p3mat,nhstepm,agedeb,hstepm,p,prevacurrent,nlstate,stepm,oldm,savm, dnewm, doldm, dsavm, k); */ |
/* oldm=oldms;savm=savms; */ |
fprintf(ficrespijb,"# Cov Agex agex-h hbijx with i,j="); |
/* hbxij(p3mat,nhstepm,agedeb,hstepm,p,nlstate,stepm,oldm,savm, k); */ |
|
hbxij(p3mat,nhstepm,agedeb,hstepm,p,prevacurrent,nlstate,stepm, k, nres);/* Bug valgrind */ |
|
/* hbxij(p3mat,nhstepm,agedeb,hstepm,p,prevacurrent,nlstate,stepm,oldm,savm, dnewm, doldm, dsavm, k); */ |
|
fprintf(ficrespijb,"# Cov Agex agex-h hbijx with i,j="); |
|
for(i=1; i<=nlstate;i++) |
|
for(j=1; j<=nlstate+ndeath;j++) |
|
fprintf(ficrespijb," %1d-%1d",i,j); |
|
fprintf(ficrespijb,"\n"); |
|
for (h=0; h<=nhstepm; h++){ |
|
/*agedebphstep = agedeb + h*hstepm/YEARM*stepm;*/ |
|
fprintf(ficrespijb,"%d %3.f %3.f",k, agedeb, agedeb - h*hstepm/YEARM*stepm ); |
|
/* fprintf(ficrespijb,"%d %3.f %3.f",k, agedeb, agedeb + h*hstepm/YEARM*stepm ); */ |
for(i=1; i<=nlstate;i++) |
for(i=1; i<=nlstate;i++) |
for(j=1; j<=nlstate+ndeath;j++) |
for(j=1; j<=nlstate+ndeath;j++) |
fprintf(ficrespijb," %1d-%1d",i,j); |
fprintf(ficrespijb," %.5f", p3mat[i][j][h]);/* Bug valgrind */ |
fprintf(ficrespijb,"\n"); |
fprintf(ficrespijb,"\n"); |
for (h=0; h<=nhstepm; h++){ |
} |
/*agedebphstep = agedeb + h*hstepm/YEARM*stepm;*/ |
free_ma3x(p3mat,1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); |
fprintf(ficrespijb,"%d %3.f %3.f",k, agedeb, agedeb - h*hstepm/YEARM*stepm ); |
fprintf(ficrespijb,"\n"); |
/* fprintf(ficrespijb,"%d %3.f %3.f",k, agedeb, agedeb + h*hstepm/YEARM*stepm ); */ |
} /* end age deb */ |
for(i=1; i<=nlstate;i++) |
/* } /\* end combination *\/ */ |
for(j=1; j<=nlstate+ndeath;j++) |
|
fprintf(ficrespijb," %.5f", p3mat[i][j][h]);/* Bug valgrind */ |
|
fprintf(ficrespijb,"\n"); |
|
} |
|
free_ma3x(p3mat,1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); |
|
fprintf(ficrespijb,"\n"); |
|
} /* end age deb */ |
|
} /* end combination */ |
|
} /* end nres */ |
} /* end nres */ |
return 0; |
return 0; |
} /* hBijx */ |
} /* hBijx */ |
Line 12447 Please run with mle=-1 to get a correct
|
Line 12575 Please run with mle=-1 to get a correct
|
mint=matrix(1,maxwav,firstobs,lastobs); |
mint=matrix(1,maxwav,firstobs,lastobs); |
anint=matrix(1,maxwav,firstobs,lastobs); |
anint=matrix(1,maxwav,firstobs,lastobs); |
s=imatrix(1,maxwav+1,firstobs,lastobs); /* s[i][j] health state for wave i and individual j */ |
s=imatrix(1,maxwav+1,firstobs,lastobs); /* s[i][j] health state for wave i and individual j */ |
printf("BUG ncovmodel=%d NCOVMAX=%d 2**ncovmodel=%f BUG\n",ncovmodel,NCOVMAX,pow(2,ncovmodel)); |
/* printf("BUG ncovmodel=%d NCOVMAX=%d 2**ncovmodel=%f BUG\n",ncovmodel,NCOVMAX,pow(2,ncovmodel)); */ |
tab=ivector(1,NCOVMAX); |
tab=ivector(1,NCOVMAX); |
ncodemax=ivector(1,NCOVMAX); /* Number of code per covariate; if O and 1 only, 2**ncov; V1+V2+V3+V4=>16 */ |
ncodemax=ivector(1,NCOVMAX); /* Number of code per covariate; if O and 1 only, 2**ncov; V1+V2+V3+V4=>16 */ |
ncodemaxwundef=ivector(1,NCOVMAX); /* Number of code per covariate; if - 1 O and 1 only, 2**ncov; V1+V2+V3+V4=>16 */ |
ncodemaxwundef=ivector(1,NCOVMAX); /* Number of code per covariate; if - 1 O and 1 only, 2**ncov; V1+V2+V3+V4=>16 */ |
Line 12740 Title=%s <br>Datafile=%s Firstpass=%d La
|
Line 12868 Title=%s <br>Datafile=%s Firstpass=%d La
|
fprintf(fichtm,"<hr size=\"2\" color=\"#EC5E5E\"> \n\ |
fprintf(fichtm,"<hr size=\"2\" color=\"#EC5E5E\"> \n\ |
<font size=\"2\">IMaCh-%s <br> %s</font> \ |
<font size=\"2\">IMaCh-%s <br> %s</font> \ |
<hr size=\"2\" color=\"#EC5E5E\"> \n\ |
<hr size=\"2\" color=\"#EC5E5E\"> \n\ |
This file: <a href=\"%s\">%s</a>Title=%s <br>Datafile=<a href=\"%s\">%s</a> Firstpass=%d Lastpass=%d Stepm=%d Weight=%d Model=1+age+%s<br>\n\ |
This file: <a href=\"%s\">%s</a></br>Title=%s <br>Datafile=<a href=\"%s\">%s</a> Firstpass=%d Lastpass=%d Stepm=%d Weight=%d Model=1+age+%s<br>\n\ |
\n\ |
\n\ |
<hr size=\"2\" color=\"#EC5E5E\">\ |
<hr size=\"2\" color=\"#EC5E5E\">\ |
<ul><li><h4>Parameter files</h4>\n\ |
<ul><li><h4>Parameter files</h4>\n\ |
Line 13742 Please run with mle=-1 to get a correct
|
Line 13870 Please run with mle=-1 to get a correct
|
printf("V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
printf("V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); |
} |
} |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ |
printf(" V%d=%f ",TvarsQ[j], TinvDoQresult[nres][TvarsQ[j]]); /* TvarsQ[j] gives the name of the jth quantitative (fixed or time v) */ |
printf(" V%d=%lg ",TvarsQ[j], TinvDoQresult[nres][TvarsQ[j]]); /* TvarsQ[j] gives the name of the jth quantitative (fixed or time v) */ |
fprintf(ficreseij,"V%d=%f ",TvarsQ[j], TinvDoQresult[nres][TvarsQ[j]]); |
fprintf(ficreseij,"V%d=%lg ",TvarsQ[j], TinvDoQresult[nres][TvarsQ[j]]); |
} |
} |
fprintf(ficreseij,"******\n"); |
fprintf(ficreseij,"******\n"); |
printf("******\n"); |
printf("******\n"); |
Line 13761 Please run with mle=-1 to get a correct
|
Line 13889 Please run with mle=-1 to get a correct
|
|
|
|
|
/*---------- State-specific expectancies and variances ------------*/ |
/*---------- State-specific expectancies and variances ------------*/ |
|
/* Should be moved in a function */ |
strcpy(filerest,"T_"); |
strcpy(filerest,"T_"); |
strcat(filerest,fileresu); |
strcat(filerest,fileresu); |
if((ficrest=fopen(filerest,"w"))==NULL) { |
if((ficrest=fopen(filerest,"w"))==NULL) { |
Line 13835 Please run with mle=-1 to get a correct
|
Line 13963 Please run with mle=-1 to get a correct
|
printf("\n j=%d In computing T_ Dummy[modelresult[%d][%d]]=%d, modelresult[%d][%d]=%d cptcovs=%d, cptcoveff=%d Fixed[modelresult[nres][j]]=%d\n", j, nres, j, Dummy[modelresult[nres][j]],nres,j,modelresult[nres][j],cptcovs, cptcoveff,Fixed[modelresult[nres][j]]); /* end if dummy or quanti */ |
printf("\n j=%d In computing T_ Dummy[modelresult[%d][%d]]=%d, modelresult[%d][%d]=%d cptcovs=%d, cptcoveff=%d Fixed[modelresult[nres][j]]=%d\n", j, nres, j, Dummy[modelresult[nres][j]],nres,j,modelresult[nres][j],cptcovs, cptcoveff,Fixed[modelresult[nres][j]]); /* end if dummy or quanti */ |
|
|
if(Dummy[modelresult[nres][j]]==0){/* Dummy variable of the variable in position modelresult in the model corresponding to j in resultline */ |
if(Dummy[modelresult[nres][j]]==0){/* Dummy variable of the variable in position modelresult in the model corresponding to j in resultline */ |
printf("V%d=%d ",Tvresult[nres][j],Tresult[nres][j]); /* Output of each value for the combination TKresult[nres], ordere by the covariate values in the resultline */ |
printf("V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][j]); /* Output of each value for the combination TKresult[nres], ordere by the covariate values in the resultline */ |
fprintf(ficlog,"V%d=%d ",Tvresult[nres][j],Tresult[nres][j]); /* Output of each value for the combination TKresult[nres], ordere by the covariate values in the resultline */ |
fprintf(ficlog,"V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][j]); /* Output of each value for the combination TKresult[nres], ordere by the covariate values in the resultline */ |
fprintf(ficrest,"V%d=%d ",Tvresult[nres][j],Tresult[nres][j]); /* Output of each value for the combination TKresult[nres], ordere by the covariate values in the resultline */ |
fprintf(ficrest,"V%d=%lg ",Tvresult[nres][j],TinvDoQresult[nres][j]); /* Output of each value for the combination TKresult[nres], ordere by the covariate values in the resultline */ |
if(Fixed[modelresult[nres][j]]==0){ /* Fixed */ |
if(Fixed[modelresult[nres][j]]==0){ /* Fixed */ |
printf("fixed ");fprintf(ficlog,"fixed ");fprintf(ficrest,"fixed "); |
printf("fixed ");fprintf(ficlog,"fixed ");fprintf(ficrest,"fixed "); |
}else{ |
}else{ |
Line 13847 Please run with mle=-1 to get a correct
|
Line 13975 Please run with mle=-1 to get a correct
|
/* fprintf(ficlog,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
/* fprintf(ficlog,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
}else if(Dummy[modelresult[nres][j]]==1){ /* Quanti variable */ |
}else if(Dummy[modelresult[nres][j]]==1){ /* Quanti variable */ |
/* For each selected (single) quantitative value */ |
/* For each selected (single) quantitative value */ |
printf(" V%d=%f ",Tvqresult[nres][j],Tqresult[nres][j]); |
printf(" V%d=%lg ",Tvqresult[nres][j],Tqresult[nres][j]); |
|
fprintf(ficlog," V%d=%lg ",Tvqresult[nres][j],Tqresult[nres][j]); |
|
fprintf(ficrest," V%d=%lg ",Tvqresult[nres][j],Tqresult[nres][j]); |
if(Fixed[modelresult[nres][j]]==0){ /* Fixed */ |
if(Fixed[modelresult[nres][j]]==0){ /* Fixed */ |
printf("fixed ");fprintf(ficlog,"fixed ");fprintf(ficrest,"fixed "); |
printf("fixed ");fprintf(ficlog,"fixed ");fprintf(ficrest,"fixed "); |
}else{ |
}else{ |
Line 13870 Please run with mle=-1 to get a correct
|
Line 14000 Please run with mle=-1 to get a correct
|
|
|
fprintf(ficresstdeij,"\n#****** "); |
fprintf(ficresstdeij,"\n#****** "); |
fprintf(ficrescveij,"\n#****** "); |
fprintf(ficrescveij,"\n#****** "); |
|
/* It could have been: for(j=1;j<=cptcoveff;j++) {printf("V=%d=%lg",Tvresult[nres][cpt],TinvDoQresult[nres][Tvresult[nres][cpt]]);} */ |
|
/* But it won't be sorted and depends on how the resultline is ordered */ |
for(j=1;j<=cptcoveff;j++) { |
for(j=1;j<=cptcoveff;j++) { |
fprintf(ficresstdeij,"V%d=%d ",Tvresult[nres][j],Tresult[nres][j]); |
fprintf(ficresstdeij,"V%d=%d ",Tvresult[nres][j],Tresult[nres][j]); |
/* fprintf(ficresstdeij,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
/* fprintf(ficresstdeij,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
/* fprintf(ficrescveij,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
/* fprintf(ficrescveij,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[Tvaraff[j]])]); */ |
} |
} |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value, TvarsQind gives the position of a quantitative in model equation */ |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value, TvarsQind gives the position of a quantitative in model equation */ |
fprintf(ficresstdeij," V%d=%f ",Tvar[TvarsQind[j]],Tqresult[nres][resultmodel[nres][TvarsQind[j]]]); |
fprintf(ficresstdeij," V%d=%lg ",Tvar[TvarsQind[j]],Tqresult[nres][resultmodel[nres][TvarsQind[j]]]); |
fprintf(ficrescveij," V%d=%f ",Tvar[TvarsQind[j]],Tqresult[nres][resultmodel[nres][TvarsQind[j]]]); |
fprintf(ficrescveij," V%d=%lg ",Tvar[TvarsQind[j]],Tqresult[nres][resultmodel[nres][TvarsQind[j]]]); |
} |
} |
fprintf(ficresstdeij,"******\n"); |
fprintf(ficresstdeij,"******\n"); |
fprintf(ficrescveij,"******\n"); |
fprintf(ficrescveij,"******\n"); |
Line 13889 Please run with mle=-1 to get a correct
|
Line 14021 Please run with mle=-1 to get a correct
|
/* fprintf(ficresvij,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[TnsdVar[Tvaraff[j]]])]); */ |
/* fprintf(ficresvij,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,TnsdVar[TnsdVar[Tvaraff[j]]])]); */ |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ |
for (j=1; j<= nsq; j++){ /* For each selected (single) quantitative value */ |
/* fprintf(ficresvij," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][j]); /\* To solve *\/ */ |
/* fprintf(ficresvij," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][j]); /\* To solve *\/ */ |
fprintf(ficresvij," V%d=%f ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); /* Solved */ |
fprintf(ficresvij," V%d=%lg ",Tvqresult[nres][j],Tqresult[nres][resultmodel[nres][j]]); /* Solved */ |
} |
} |
fprintf(ficresvij,"******\n"); |
fprintf(ficresvij,"******\n"); |
|
|