--- imach/src/imach.c 2022/09/09 17:55:22 1.339
+++ imach/src/imach.c 2022/09/11 19:54:09 1.342
@@ -1,6 +1,28 @@
-/* $Id: imach.c,v 1.339 2022/09/09 17:55:22 brouard Exp $
+/* $Id: imach.c,v 1.342 2022/09/11 19:54:09 brouard Exp $
$State: Exp $
$Log: imach.c,v $
+ Revision 1.342 2022/09/11 19:54:09 brouard
+ Summary: 0.99r38
+
+ * imach.c (Module): Adding timevarying products of any kinds,
+ should work before shifting cotvar from ncovcol+nqv columns in
+ order to have a correspondance between the column of cotvar and
+ the id of column.
+ (Module): Some cleaning and adding covariates in ILK.txt
+
+ Revision 1.341 2022/09/11 07:58:42 brouard
+ Summary: Version 0.99r38
+
+ After adding change in cotvar.
+
+ Revision 1.340 2022/09/11 07:53:11 brouard
+ Summary: Version imach 0.99r37
+
+ * imach.c (Module): Adding timevarying products of any kinds,
+ should work before shifting cotvar from ncovcol+nqv columns in
+ order to have a correspondance between the column of cotvar and
+ the id of column.
+
Revision 1.339 2022/09/09 17:55:22 brouard
Summary: version 0.99r37
@@ -1308,15 +1330,16 @@ typedef struct {
#define ODIRSEPARATOR '\\'
#endif
-/* $Id: imach.c,v 1.339 2022/09/09 17:55:22 brouard Exp $ */
+/* $Id: imach.c,v 1.342 2022/09/11 19:54:09 brouard Exp $ */
/* $State: Exp $ */
#include "version.h"
char version[]=__IMACH_VERSION__;
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: 1.339 $ $Date: 2022/09/09 17:55:22 $";
+char fullversion[]="$Revision: 1.342 $ $Date: 2022/09/11 19:54:09 $";
char strstart[80];
char optionfilext[10], optionfilefiname[FILENAMELENGTH];
int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */
+int debugILK=0; /* debugILK is set by a #d in a comment line */
int nagesqr=0, nforce=0; /* nagesqr=1 if model is including age*age, number of forces */
/* Number of covariates model (1)=V2+V1+ V3*age+V2*V4 */
/* Model(2) V1 + V2 + V3 + V8 + V7*V8 + V5*V6 + V8*age + V3*age + age*age */
@@ -1495,7 +1518,7 @@ double **covar; /**< covar[j,i], value
* covar=matrix(0,NCOVMAX,1,n);
* cov[Tage[kk]+2]=covar[Tvar[Tage[kk]]][i]*age; */
double **coqvar; /* Fixed quantitative covariate nqv */
-double ***cotvar; /* Time varying covariate ntv */
+double ***cotvar; /* Time varying covariate start at ncovcol + nqv + (1 to ntv) */
double ***cotqvar; /* Time varying quantitative covariate itqv */
double idx;
int **nbcode, *Tvar; /**< model=V2 => Tvar[1]= 2 */
@@ -1507,7 +1530,7 @@ int **nbcode, *Tvar; /**< model=V2 => Tv
* cptcovn number of covariates (not including constant and age or age*age) = number of plus sign + 1 = 10+1=11
* For time varying covariate, quanti or dummies
* cotqvar[wav][iv(1 to nqtv)][i]= [1][12][i]=(V12) quanti
- * cotvar[wav][ntv+iv][i]= [3+(1 to nqtv)][i]=(V12) quanti
+ * cotvar[wav][ncovcol+nqv+ iv(1 to nqtv)][i]= [(1 to nqtv)][i]=(V12) quanti
* cotvar[wav][iv(1 to ntv)][i]= [1][1][i]=(V9) dummies at wav 1
* cotvar[wav][iv(1 to ntv)][i]= [1][2][i]=(V10) dummies at wav 1
* covar[Vk,i], value of the Vkth fixed covariate dummy or quanti for individual i:
@@ -3880,6 +3903,7 @@ double func( double *x)
int ioffset=0;
int ipos=0,iposold=0,ncovv=0;
+ double cotvarv, cotvarvold;
double l, ll[NLSTATEMAX+1], cov[NCOVMAX+1];
double **out;
double lli; /* Individual log likelihood */
@@ -3927,7 +3951,7 @@ double func( double *x)
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]
+ And the iv th varying covariate is the cotvar[mw[mi+1][i]][iv][i] because now is moved after nvocol+nqv
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]
*/
@@ -3937,25 +3961,21 @@ double func( double *x)
/* /\* 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]; */
/* } */
- for(ncovv=1, ipos=0; ncovv <= ncovvt ; ncovv++){ /* Varying covariates (single and product but no age )*/
- itv=TvarVV[ncovv]; /* TvarVV={3, 1, 3} */
- ipos=TvarVVind[ncovv]; /* TvarVVind={2, 5, 5] */
+ for(ncovv=1, iposold=0; ncovv <= ncovvt ; ncovv++){ /* Varying covariates (single and product but no age )*/
+ itv=TvarVV[ncovv]; /* TvarVV={3, 1, 3} gives the name of each varying covariate */
+ ipos=TvarVVind[ncovv]; /* TvarVVind={2, 5, 5] gives the position in the model of the ncovv th varying covariate*/
+ if(TvarFind[itv]==0){ /* Not a fixed covariate */
+ cotvarv=cotvar[mw[mi][i]][TvarVV[ncovv]][i]; /* cotvar[wav][ncovcol+nqv+iv][i] */
+ }else{ /* fixed covariate */
+ cotvarv=covar[Tvar[TvarFind[itv]]][i];
+ }
if(ipos!=iposold){ /* Not a product or first of a product */
- /* TvarFind={1,0,0,0} */
- if(TvarFind[itv]==0){
- cov[ioffset+ipos]= cotvar[mw[mi][i]][ncovv][i]; /* Should be covar if fixed covar[Tvar[TvarFind[itv]]][i]*/
- }else{
- cov[ioffset+ipos]=covar[Tvar[TvarFind[itv]]][i];
- }
- }else{
- if(TvarFind[itv]==0){
- cov[ioffset+ipos]*= cotvar[mw[mi][i]][ncovv][i]; /* Should be covar if fixed covar[Tvar[TvarFind[itv]]][i]*/
- }else{
- cov[ioffset+ipos]*=covar[Tvar[TvarFind[itv]]][i];
- }
+ cotvarvold=cotvarv;
+ }else{ /* A second product */
+ cotvarv=cotvarv*cotvarvold;
}
iposold=ipos;
- /* For products */
+ cov[ioffset+ipos]=cotvarv;
}
/* for(itv=1; itv <= ntveff; itv++){ /\* Varying dummy covariates (single??)*\/ */
/* iv= Tvar[Tmodelind[ioffset-2-nagesqr-cptcovage+itv]]-ncovcol-nqv; /\* Counting the # varying covariate from 1 to ntveff *\/ */
@@ -3988,7 +4008,7 @@ double func( double *x)
if(!FixedV[Tvar[Tage[kk]]])
cov[Tage[kk]+2+nagesqr]=covar[Tvar[Tage[kk]]][i]*agexact; /* Tage[kk] gives the data-covariate associated with age */
else
- cov[Tage[kk]+2+nagesqr]=cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]*agexact;
+ cov[Tage[kk]+2+nagesqr]=cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]*agexact; /* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
}
out=matprod2(newm,oldm,1,nlstate+ndeath,1,nlstate+ndeath,
1,nlstate+ndeath,pmij(pmmij,cov,ncovmodel,x,nlstate));
@@ -4084,7 +4104,7 @@ double func( double *x)
}
/*lli=(1.+bbh)*log(out[s1][s2])- bbh*log(savm[s1][s2]);*/
/*if(lli ==000.0)*/
- /*printf("bbh= %f lli=%f savm=%f out=%f %d\n",bbh,lli,savm[s1][s2], out[s[mw[mi][i]][i]][s[mw[mi+1][i]][i]],i); */
+ /* printf("num[i], i=%d, bbh= %f lli=%f savm=%f out=%f %d\n",bbh,lli,savm[s1][s2], out[s[mw[mi][i]][i]][s[mw[mi+1][i]][i]],i); */
ipmx +=1;
sw += weight[i];
ll[s[mw[mi][i]][i]] += 2*weight[i]*lli;
@@ -4101,7 +4121,7 @@ double func( double *x)
cov[ioffset+TvarFind[k]]=covar[Tvar[TvarFind[k]]][i];
for(mi=1; mi<= wav[i]-1; mi++){
for(k=1; k <= ncovv ; k++){
- 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]]][i]; /* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
}
for (ii=1;ii<=nlstate+ndeath;ii++)
for (j=1;j<=nlstate+ndeath;j++){
@@ -4148,7 +4168,10 @@ double func( double *x)
if(nagesqr==1)
cov[3]= agexact*agexact;
for (kk=1; kk<=cptcovage;kk++) {
- cov[Tage[kk]+2+nagesqr]=covar[Tvar[Tage[kk]]][i]*agexact;
+ if(!FixedV[Tvar[Tage[kk]]])
+ cov[Tage[kk]+2+nagesqr]=covar[Tvar[Tage[kk]]][i]*agexact; /* Tage[kk] gives the data-covariate associated with age */
+ else
+ cov[Tage[kk]+2+nagesqr]=cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]*agexact; /* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
}
out=matprod2(newm,oldm,1,nlstate+ndeath,1,nlstate+ndeath,
1,nlstate+ndeath,pmij(pmmij,cov,ncovmodel,x,nlstate));
@@ -4204,7 +4227,7 @@ double func( double *x)
ipmx +=1;
sw += weight[i];
ll[s[mw[mi][i]][i]] += 2*weight[i]*lli;
-/* printf("i=%6d s1=%1d s2=%1d mi=%1d mw=%1d dh=%3d prob=%10.6f w=%6.4f out=%10.6f sav=%10.6f\n",i,s1,s2,mi,mw[mi][i],dh[mi][i],exp(lli),weight[i],out[s1][s2],savm[s1][s2]); */
+ /* printf("i=%6d s1=%1d s2=%1d mi=%1d mw=%1d dh=%3d prob=%10.6f w=%6.4f out=%10.6f sav=%10.6f\n",i,s1,s2,mi,mw[mi][i],dh[mi][i],exp(lli),weight[i],out[s1][s2],savm[s1][s2]); */
} /* end of wave */
} /* end of individual */
}else{ /* ml=5 no inter-extrapolation no jackson =0.8a */
@@ -4223,7 +4246,10 @@ double func( double *x)
if(nagesqr==1)
cov[3]= agexact*agexact;
for (kk=1; kk<=cptcovage;kk++) {
- cov[Tage[kk]+2+nagesqr]=covar[Tvar[Tage[kk]]][i]*agexact;
+ if(!FixedV[Tvar[Tage[kk]]])
+ cov[Tage[kk]+2+nagesqr]=covar[Tvar[Tage[kk]]][i]*agexact; /* Tage[kk] gives the data-covariate associated with age */
+ else
+ cov[Tage[kk]+2+nagesqr]=cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]*agexact; /* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
}
out=matprod2(newm,oldm,1,nlstate+ndeath,1,nlstate+ndeath,
@@ -4256,6 +4282,7 @@ double funcone( double *x)
int ioffset=0;
int ipos=0,iposold=0,ncovv=0;
+ double cotvarv, cotvarvold;
double l, ll[NLSTATEMAX+1], cov[NCOVMAX+1];
double **out;
double lli; /* Individual log likelihood */
@@ -4310,9 +4337,7 @@ double funcone( double *x)
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]
+ And the iv th varying covariate in the DATA is the cotvar[mw[mi+1][i]][ncovcol+nqv+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 *\/ */
@@ -4337,24 +4362,30 @@ double funcone( double *x)
/* We need the position of the time varying or product in the model */
/* TvarVVind={2,5,5}, for V3 at position 2 and then the product V1*V3 is decomposed into V1 and V3 but at same position 5 */
/* TvarVV gives the variable name */
- for(ncovv=1, ipos=0; ncovv <= ncovvt ; ncovv++){ /* Varying covariates (single and product but no age )*/
- itv=TvarVV[ncovv]; /* TvarVV={3, 1, 3} */
- ipos=TvarVVind[ncovv]; /* TvarVVind={2, 5, 5] */
+ /* Other example V1 + V3 + V5 + age*V1 + age*V3 + age*V5 + V1*V3 + V3*V5 + V1*V5
+ * k= 1 2 3 4 5 6 7 8 9
+ * varying 1 2 3 4 5
+ * ncovv 1 2 3 4 5 6 7 8
+ * TvarVV V3 5 1 3 3 5 1 5
+ * TvarVVind 2 3 7 7 8 8 9 9
+ * TvarFind[k] 1 0 0 0 0 0 0 0 0
+ * cotvar starts at ntv=2 (because of V3 V4)
+ */
+ for(ncovv=1, iposold=0; ncovv <= ncovvt ; ncovv++){ /* Varying covariates (single and product but no age) including individual from products */
+ itv=TvarVV[ncovv]; /* TvarVV={3, 1, 3} gives the name of each varying covariate */
+ ipos=TvarVVind[ncovv]; /* TvarVVind={2, 5, 5] gives the position in the model of the ncovv th varying covariate*/
+ if(TvarFind[itv]==0){ /* Not a fixed covariate */
+ cotvarv=cotvar[mw[mi][i]][TvarVV[ncovv]][i]; /* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
+ }else{ /* fixed covariate */
+ cotvarv=covar[Tvar[TvarFind[itv]]][i];
+ }
if(ipos!=iposold){ /* Not a product or first of a product */
- /* TvarFind={1,0,0,0} */
- if(TvarFind[itv]==0){
- cov[ioffset+ipos]= cotvar[mw[mi][i]][ncovv][i]; /* Should be covar if fixed covar[Tvar[TvarFind[itv]]][i]*/
- }else{
- cov[ioffset+ipos]=covar[Tvar[TvarFind[itv]]][i];
- }
- }else{
- if(TvarFind[itv]==0){
- cov[ioffset+ipos]*= cotvar[mw[mi][i]][ncovv][i]; /* Should be covar if fixed covar[Tvar[TvarFind[itv]]][i]*/
- }else{
- cov[ioffset+ipos]*=covar[Tvar[TvarFind[itv]]][i];
- }
+ cotvarvold=cotvarv;
+ }else{ /* A second product */
+ cotvarv=cotvarv*cotvarvold;
}
iposold=ipos;
+ cov[ioffset+ipos]=cotvarv;
/* For products */
}
/* for(itv=1; itv <= ntveff; itv++){ /\* Varying dummy covariates single *\/ */
@@ -4397,7 +4428,7 @@ double funcone( double *x)
if(!FixedV[Tvar[Tage[kk]]])
cov[Tage[kk]+2+nagesqr]=covar[Tvar[Tage[kk]]][i]*agexact;
else
- cov[Tage[kk]+2+nagesqr]=cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]*agexact;
+ cov[Tage[kk]+2+nagesqr]=cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]*agexact; /* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
}
/* printf("i=%d,mi=%d,d=%d,mw[mi][i]=%d\n",i, mi,d,mw[mi][i]); */
/* savm=pmij(pmmij,cov,ncovmodel,x,nlstate); */
@@ -4452,7 +4483,8 @@ double funcone( double *x)
ipmx +=1;
sw += weight[i];
ll[s[mw[mi][i]][i]] += 2*weight[i]*lli;
- /* printf("Funcone i=%6d s1=%1d s2=%1d mi=%1d mw=%1d dh=%3d prob=%10.6f w=%6.4f out=%10.6f sav=%10.6f\n",i,s1,s2,mi,mw[mi][i],dh[mi][i],exp(lli),weight[i],(s2==-1? -1: out[s1][s2]),(s2==-1? -1: savm[s1][s2])); */
+ /* Printing covariates values for each contribution for checking */
+ /* printf(" s1=%1d s2=%1d mi=%1d mw=%1d dh=%3d prob=%10.6f w=%6.4f out=%10.6f sav=%10.6f\n",s1,s2,mi,mw[mi][i],dh[mi][i],exp(lli),weight[i],(s2==-1? -1: out[s1][s2]),(s2==-1? -1: savm[s1][s2])); */
if(globpr){
fprintf(ficresilk,"%09ld %6.1f %6.1f %6d %2d %2d %2d %2d %3d %15.6f %8.4f %8.3f\
%11.6f %11.6f %11.6f ", \
@@ -4467,9 +4499,37 @@ double funcone( double *x)
fprintf(ficresilk," %10.6f",-ll[k]*gipmx/gsw);
/* printf(" %10.6f",-ll[k]*gipmx/gsw); */
}
- fprintf(ficresilk," %10.6f\n", -llt);
+ fprintf(ficresilk," %10.6f", -llt);
/* printf(" %10.6f\n", -llt); */
- }
+ /* if(debugILK){ /\* debugILK is set by a #d in a comment line *\/ */
+ fprintf(ficresilk,"%09ld ", num[i]);
+ for (kf=1; kf<=ncovf;kf++){ /* Simple and product fixed covariates without age* products *//* Missing values are set to -1 but should be dropped */
+ fprintf(ficresilk," %g",covar[Tvar[TvarFind[kf]]][i]);
+ }
+ for(ncovv=1, iposold=0; ncovv <= ncovvt ; ncovv++){ /* Varying covariates (single and product but no age) including individual from products */
+ ipos=TvarVVind[ncovv]; /* TvarVVind={2, 5, 5] gives the position in the model of the ncovv th varying covariate*/
+ if(ipos!=iposold){ /* Not a product or first of a product */
+ fprintf(ficresilk," %g",cov[ioffset+ipos]);
+ /* printf(" %g",cov[ioffset+ipos]); */
+ }else{
+ fprintf(ficresilk,"*");
+ /* printf("*"); */
+ }
+ iposold=ipos;
+ }
+ for (kk=1; kk<=cptcovage;kk++) {
+ if(!FixedV[Tvar[Tage[kk]]]){
+ fprintf(ficresilk," %g*age",covar[Tvar[Tage[kk]]][i]);
+ /* printf(" %g*age",covar[Tvar[Tage[kk]]][i]); */
+ }else{
+ fprintf(ficresilk," %g*age",cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]);/* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
+ /* printf(" %g*age",cotvar[mw[mi][i]][Tvar[Tage[kk]]][i]);/\* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) *\/ */
+ }
+ }
+ /* printf("\n"); */
+ /* } /\* End debugILK *\/ */
+ fprintf(ficresilk,"\n");
+ } /* End if globpr */
} /* end of wave */
} /* end of individual */
for(k=1,l=0.; k<=nlstate; k++) l += ll[k];
@@ -4490,8 +4550,9 @@ void likelione(FILE *ficres,double p[],
the selection of individuals/waves and
to check the exact contribution to the likelihood.
Plotting could be done.
- */
- int k;
+ */
+ void pstamp(FILE *ficres);
+ int k, kf, kk, ncovv, iposold, ipos;
if(*globpri !=0){ /* Just counts and sums, no printings */
strcpy(fileresilk,"ILK_");
@@ -4500,13 +4561,43 @@ void likelione(FILE *ficres,double p[],
printf("Problem with resultfile: %s\n", fileresilk);
fprintf(ficlog,"Problem with resultfile: %s\n", fileresilk);
}
+ pstamp(ficresilk);fprintf(ficresilk,"# model=1+age+%s\n",model);
fprintf(ficresilk, "#individual(line's_record) count ageb ageend s1 s2 wave# effective_wave# number_of_matrices_product pij weight weight/gpw -2ln(pij)*weight 0pij_x 0pij_(x-stepm) cumulating_loglikeli_by_health_state(reweighted=-2ll*weightXnumber_of_contribs/sum_of_weights) and_total\n");
fprintf(ficresilk, "#num_i ageb agend i s1 s2 mi mw dh likeli weight %%weight 2wlli out sav ");
/* i,s1,s2,mi,mw[mi][i],dh[mi][i],exp(lli),weight[i],2*weight[i]*lli,out[s1][s2],savm[s1][s2]); */
for(k=1; k<=nlstate; k++)
fprintf(ficresilk," -2*gipw/gsw*weight*ll[%d]++",k);
- fprintf(ficresilk," -2*gipw/gsw*weight*ll(total)\n");
- }
+ fprintf(ficresilk," -2*gipw/gsw*weight*ll(total) ");
+
+ /* if(debugILK){ /\* debugILK is set by a #d in a comment line *\/ */
+ for(kf=1;kf <= ncovf; kf++){
+ fprintf(ficresilk,"V%d",Tvar[TvarFind[kf]]);
+ /* printf("V%d",Tvar[TvarFind[kf]]); */
+ }
+ for(ncovv=1, iposold=0; ncovv <= ncovvt ; ncovv++){
+ ipos=TvarVVind[ncovv]; /* TvarVVind={2, 5, 5] gives the position in the model of the ncovv th varying covariate*/
+ if(ipos!=iposold){ /* Not a product or first of a product */
+ /* printf(" %d",ipos); */
+ fprintf(ficresilk," V%d",TvarVV[ncovv]);
+ }else{
+ /* printf("*"); */
+ fprintf(ficresilk,"*");
+ }
+ iposold=ipos;
+ }
+ for (kk=1; kk<=cptcovage;kk++) {
+ if(!FixedV[Tvar[Tage[kk]]]){
+ /* printf(" %d*age(Fixed)",Tvar[Tage[kk]]); */
+ fprintf(ficresilk," %d*age(Fixed)",Tvar[Tage[kk]]);
+ }else{
+ fprintf(ficresilk," %d*age(Varying)",Tvar[Tage[kk]]);/* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) */
+ /* printf(" %d*age(Varying)",Tvar[Tage[kk]]);/\* because cotvar starts now at first ncovcol+nqv+ (1 to nqtv) *\/ */
+ }
+ }
+ /* } /\* End if debugILK *\/ */
+ /* printf("\n"); */
+ fprintf(ficresilk,"\n");
+ } /* End glogpri */
*fretone=(*func)(p);
if(*globpri !=0){
@@ -5249,7 +5340,8 @@ Title=%s
Datafile=%s Firstpass=%d La
if(anyvaryingduminmodel==1){ /* Some are varying covariates */
for (z1=1; z1<=cptcoveff; z1++) {
if( Fixed[Tmodelind[z1]]==1){
- iv= Tvar[Tmodelind[z1]]-ncovcol-nqv;
+ /* iv= Tvar[Tmodelind[z1]]-ncovcol-nqv; /\* Good *\/ */
+ iv= Tvar[Tmodelind[z1]]; /* Good *//* because cotvar starts now at first at ncovcol+nqv+ntv */
if (cotvar[m][iv][iind]!= nbcode[Tvaraff[z1]][codtabm(j1,TnsdVar[Tvaraff[z1]])]) /* iv=1 to ntv, right modality. If covariate's
value is -1, we don't select. It differs from the
constant and age model which counts them. */
@@ -5330,7 +5422,7 @@ Title=%s
Datafile=%s Firstpass=%d La
fprintf(ficresphtm, "\n