/* $Id$
$State$
$Log$
+ Revision 1.320 2022/06/02 05:10:11 brouard
+ *** empty log message ***
+
Revision 1.319 2022/06/02 04:45:11 brouard
* imach.c (Module): Adding the Wald tests from the log to the main
htm for better display of the maximum likelihood estimators.
}
/* if(nqfveff+nqtveff 0) */ /* Test to be done */
- fprintf(fichtm," ************\n<hr size=\"2\" color=\"#EC5E5E\">");
+ fprintf(fichtm," (model=%s) ************\n<hr size=\"2\" color=\"#EC5E5E\">",model);
if(invalidvarcomb[k1]){
fprintf(fichtm,"\n<h3>Combination (%d) ignored because no cases </h3>\n",k1);
printf("\nCombination (%d) ignored because no cases \n",k1);
fprintf(fichtm," V%d=%f ",Tvqresult[nres][k4],Tqresult[nres][k4]);
}
- fprintf(fichtm," ************\n<hr size=\"2\" color=\"#EC5E5E\">");
+ fprintf(fichtm," (model=%s) ************\n<hr size=\"2\" color=\"#EC5E5E\">",model);
if(invalidvarcomb[k1]){
fprintf(fichtm,"\n<h4>Combination (%d) ignored because no cases </h4>\n",k1);
fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" \n",subdirf2(optionfilefiname,"V_"),cpt,k1,nres);
fprintf(ficgp,"\n#set out \"V_%s_%d-%d-%d.svg\" \n",optionfilefiname,cpt,k1,nres);
/* fprintf(ficgp,"set label \"Alive state %d %s\" at graph 0.98,0.5 center rotate font \"Helvetica,12\"\n",cpt,gplotlabel); */
- fprintf(ficgp,"set title \"Alive state %d %s\" font \"Helvetica,12\"\n",cpt,gplotlabel);
+ fprintf(ficgp,"set title \"Alive state %d %s model=%s\" font \"Helvetica,12\"\n",cpt,gplotlabel,model);
fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \nset ter svg size 640, 480\nplot [%.f:%.f] \"%s\" every :::%d::%d u 1:($2==%d ? $3:1/0) \"%%lf %%lf",ageminpar,fage,subdirf2(fileresu,"VPL_"),nres-1,nres-1,nres);
/* fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \nset ter svg size 640, 480\nplot [%.f:%.f] \"%s\" every :::%d::%d u 1:($2==%d ? $3:1/0) \"%%lf %%lf",ageminpar,fage,subdirf2(fileresu,"VPL_"),k1-1,k1-1,nres); */
/* k1-1 error should be nres-1*/
hesscov(matcov, hess, p, npar, delti, ftolhess, func);
printf("Parameters and 95%% confidence intervals\n W is simply the result of the division of the parameter by the square root of covariance of the parameter.\n And Wald-based confidence intervals plus and minus 1.96 * W .\n But be careful that parameters are highly correlated because incidence of disability is highly correlated to incidence of recovery.\n It might be better to visualize the covariance matrix. See the page 'Matrix of variance-covariance of one-step probabilities' and its graphs.\n");
fprintf(ficlog, "Parameters, Wald tests and Wald-based confidence intervals\n W is simply the result of the division of the parameter by the square root of covariance of the parameter.\n And Wald-based confidence intervals plus and minus 1.96 * W \n It might be better to visualize the covariance matrix. See the page 'Matrix of variance-covariance of one-step probabilities' and its graphs.\n");
+ fprintf(fichtm, "\n<p>Parameters, Wald tests and Wald-based confidence intervals\n</br> W is simply the result of the division of the parameter by the square root of covariance of the parameter.\n</br> And Wald-based confidence intervals plus and minus 1.96 * W \n </br> It might be better to visualize the covariance matrix. See the page 'Matrix of variance-covariance of one-step probabilities' and its graphs.\n</br>");
fprintf(fichtm,"\n<table style=\"text-align:center; border: 1px solid\">");
fprintf(fichtm, "\n<tr><th>Model=</th><th>1</th><th>+ age</th>");
if(nagesqr==1){
fprintf(fichtm, "<td>%1d%1d</td>",i,k);
for(j=1; j <=ncovmodel; j++){
wald=p[jk]/sqrt(matcov[jk][jk]);
- printf("%12.7f(%12.7f) W=%8.3f CI=[%12.7f ; %12.7f] ",p[jk],sqrt(matcov[jk][jk]), p[jk]/sqrt(matcov[jk][jk]), p[jk]-1.96*sqrt(matcov[jk][jk]),p[jk]+1.96*sqrt(matcov[jk][jk]));
- fprintf(ficlog,"%12.7f(%12.7f) W=%8.3f CI=[%12.7f ; %12.7f] ",p[jk],sqrt(matcov[jk][jk]), p[jk]/sqrt(matcov[jk][jk]), p[jk]-1.96*sqrt(matcov[jk][jk]),p[jk]+1.96*sqrt(matcov[jk][jk]));
+ printf("%12.7f(%12.7f) sqrt(W)=%8.3f CI=[%12.7f ; %12.7f] ",p[jk],sqrt(matcov[jk][jk]), p[jk]/sqrt(matcov[jk][jk]), p[jk]-1.96*sqrt(matcov[jk][jk]),p[jk]+1.96*sqrt(matcov[jk][jk]));
+ fprintf(ficlog,"%12.7f(%12.7f) sqrt(W)=%8.3f CI=[%12.7f ; %12.7f] ",p[jk],sqrt(matcov[jk][jk]), p[jk]/sqrt(matcov[jk][jk]), p[jk]-1.96*sqrt(matcov[jk][jk]),p[jk]+1.96*sqrt(matcov[jk][jk]));
if(fabs(wald) > 1.96){
- fprintf(fichtm, "<td><b>%12.7f</b> (%12.7f)</br>",p[jk],sqrt(matcov[jk][jk]));
- fprintf(fichtm,"<b>W=%8.3f</b></br>",wald);
+ fprintf(fichtm, "<td><b>%12.7f</b></br> (%12.7f)</br>",p[jk],sqrt(matcov[jk][jk]));
}else{
fprintf(fichtm, "<td>%12.7f (%12.7f)</br>",p[jk],sqrt(matcov[jk][jk]));
- fprintf(fichtm,"W=%8.3f</br>",wald);
}
+ fprintf(fichtm,"sqrt(W)=%8.3f</br>",wald);
fprintf(fichtm,"[%12.7f;%12.7f]</br></td>", p[jk]-1.96*sqrt(matcov[jk][jk]),p[jk]+1.96*sqrt(matcov[jk][jk]));
jk++;
}
for(k=1; k<=i1;k++){ /* For any combination of dummy covariates, fixed and varying */
if(i1 != 1 && TKresult[nres]!= k)
continue;
- printf("\n#****** Result for:");
- fprintf(ficrest,"\n#****** Result for:");
- fprintf(ficlog,"\n#****** Result for:");
+ printf("\n# model %s \n#****** Result for:", model);
+ fprintf(ficrest,"\n# model %s \n#****** Result for:", model);
+ fprintf(ficlog,"\n# model %s \n#****** Result for:", model);
for(j=1;j<=cptcoveff;j++){
printf("V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,j)]);
fprintf(ficrest,"V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtabm(k,j)]);