Valid XHTML     Valid CSS2    

Listing du fichier vd.php

 

00001     <?php
00002     
00003     error_reporting(
E_ALL) ;
00004     
00005     #   # (gH)   -_-  vd.php  ;  TimeStamp (unix) : 14 Septembre 2016 vers 11:45
00006     
00007     #include_once("../stdutf.php")       ; # mettre include("std.php") ; pour un serveur non UTF
00008     include_once(
"../statuno.php") ; # pour les calculs en R
00009     
00010     #########################################################
00011     
00012     $host   
getenv("HTTP_HOST") ;
00013     $newUrl 
"http://forge.info.univ-angers.fr/~gh/wstat/vd.php" ;
00014     
00015     if ($host
=="www.info.univ-angers.fr") {
00016       debutPageRedir
("redirection",0,$newUrl) ;
00017       finPage
() ;
00018       exit(-1
) ;
00019     } # fin si
00020     
00021     #########################################################
00022     
00023     $versionVD 
1.53 ;
00024     
00025     #########################################################
00026     #
00027     # le programme principal est tout &agrave; la fin
00028     #
00029     #########################################################
00030     
00031     # h1("Etude de valeurs diagnostiques (gH) version $versionVD") ;
00032     
00033     #########################################################
00034     
00035     function 
donneesXmp() {  global $xmp$txmp$na$nb$nc$nd$mf ;
00036     
00037     #########################################################
00038     
00039     
00040     $xmp 
"" ;
00041     if (isset($_GET
["xmp"])) {
00042        $xmp 
$_GET["xmp"] ;
00043     } ; # fin de si
00044     
00045     if (isset(
$_POST["txmp"])) {
00046        $txmp 
$_POST["txmp"] ;
00047     } ; # fin de si
00048     
00049     if (
$xmp==0)  {       $na =   "" ;       $nb =   "" ;       $nc =   "" ;       $nd =   "" ;    } ; # fin de si
00050     if (
$xmp=="") {       $na =   "" ;       $nb =   "" ;       $nc =   "" ;       $nd =   "" ;    } ; # fin de si
00051     
00052     if (isset(
$_POST["Na"]))      { $xmp $na $_POST["Na"] ; } ;
00053     if (isset($_POST
["Nb"]))      { $xmp $nb $_POST["Nb"] ; } ;
00054     if (isset($_POST
["Nc"]))      { $xmp $nc $_POST["Nc"] ; } ;
00055     if (isset($_POST
["Nd"]))      { $xmp $nd $_POST["Nd"] ; } ;
00056     
00057     if (isset($_GET
["Na"]))      { $xmp 100 $na $_GET["Na"] ; } ;
00058     if (isset($_GET
["Nb"]))      { $xmp 100 $nb $_GET["Nb"] ; } ;
00059     if (isset($_GET
["Nc"]))      { $xmp 100 $nc $_GET["Nc"] ; } ;
00060     if (isset($_GET
["Nd"]))      { $xmp 100 $nd $_GET["Nd"] ; } ;
00061     
00062     if (isset($_POST
["risette"])) { $xmp $txmp $mf ; } ;
00063     if (isset($_POST
["xmp1"]))    { $xmp $txmp $mf ; } ; # Harvard
00064     if (isset(
$_POST["xmp2"]))    { $xmp $txmp $mf ; } ; # S7
00065     if (isset(
$_POST["xmp3"]))    { $xmp $txmp $mf ; } ; # S8
00066     if (isset(
$_POST["xmp4"]))    { $xmp $txmp $mf ; } ; # S817
00067     if (isset(
$_POST["xmp5"]))    { $xmp $txmp $mf ; } ; # Sas
00068     if (isset(
$_POST["xmp6"]))    { $xmp $txmp $mf ; } ; # Falissard
00069     if (isset(
$_POST["xmp7"]))    { $xmp $txmp $mf ; } ; # S817 Hommes
00070     if (isset(
$_POST["xmp8"]))    { $xmp $txmp $mf ; } ; # S817 Femmes
00071     if (isset(
$_POST["xmp9"]))    { $xmp $txmp $mf ; } ; # bewick 1
00072     if (isset(
$_POST["xmp10"]))   { $xmp 10$txmp 10$mf ; } ; # bewick 2
00073     if (isset(
$_POST["xmp11"]))   { $xmp 11$txmp 11$mf ; } ; # 100 % de BC      faible pr&eacute;valence
00074     if (isset(
$_POST["xmp12"]))   { $xmp 12$txmp 12$mf ; } ; #   0 % de BC
00075     if (isset(
$_POST["xmp13"]))   { $xmp 13$txmp 13$mf ; } ; # &eacute;quir&eacute;partition
00076     if (isset(
$_POST["xmp14"]))   { $xmp 14$txmp 14$mf ; } ; # 100 % de BC      pr&eacute;valence moyenne
00077     if (isset(
$_POST["xmp15"]))   { $xmp 15$txmp 15$mf ; } ; #   0 % de BC
00078     if (isset(
$_POST["xmp16"]))   { $xmp 16$txmp 16$mf ; } ; # &eacute;quir&eacute;partition
00079     if (isset(
$_POST["xmp17"]))   { $xmp 17$txmp 17$mf ; } ; # 100 % de BC      forte pr&eacute;valence
00080     if (isset(
$_POST["xmp18"]))   { $xmp 18$txmp 18$mf ; } ; #   0 % de BC
00081     if (isset(
$_POST["xmp19"]))   { $xmp 19$txmp 19$mf ; } ; # &eacute;quir&eacute;partition
00082     
00083     if (isset(
$_POST["xmp20"]))   { $xmp 20$txmp 20$mf ; } ; #
00084     if (isset(
$_POST["xmp21"]))   { $xmp 21$txmp 21$mf ; } ; #
00085     if (isset(
$_POST["xmp22"]))   { $xmp 22$txmp 22$mf ; } ; #
00086     if (isset(
$_POST["xmp23"]))   { $xmp 23$txmp 23$mf ; } ; #
00087     
00088     if (isset(
$_POST["xmp24"]))   { $xmp 24$txmp 24$mf ; } ; #
00089     if (isset(
$_POST["xmp25"]))   { $xmp 25$txmp 25$mf ; } ; #
00090     if (isset(
$_POST["xmp26"]))   { $xmp 26$txmp 26$mf ; } ; #
00091     if (isset(
$_POST["xmp27"]))   { $xmp 27$txmp 27$mf ; } ; #
00092     
00093     
00094        if (
$xmp==1) {       $na =    ;       $nb =   50 ;       $nc =    ;       $nd =  949 ;    } ; # fin de si
00095        if (
$xmp==2) {       $na =  301 ;       $nb =   93 ;       $nc =   99 ;       $nd =  332 ;    } ; # fin de si
00096        if (
$xmp==3) {       $na =  284 ;       $nb =   81 ;       $nc =  116 ;       $nd =  344 ;    } ; # fin de si
00097        if (
$xmp==4) {       $na =  277 ;       $nb =   77 ;       $nc =  123 ;       $nd =  348 ;    } ; # fin de si
00098        if (
$xmp==5) {       $na =   11 ;       $nb =    ;       $nc =    ;       $nd =    ;    } ; # fin de si
00099        if (
$xmp==6) {       $na =   37 ;       $nb =   71 ;       $nc =   31 ;       $nd =  117 ;    } ; # fin de si
00100        if (
$xmp==7) {       $na =  189 ;       $nb =   50 ;       $nc =   73 ;       $nd =  179 ;    } ; # fin de si
00101        if (
$xmp==9) {       $na =   81 ;       $nb =  591 ;       $nc =   45 ;       $nd =  674 ;    } ; # fin de si
00102        if (
$xmp==10){       $na =  385 ;       $nb =  371 ;       $nc =  214 ;       $nd =  421 ;    } ; # fin de si
00103        if (
$xmp==11){       $na =   50 ;       $nb =    ;       $nc =    ;       $nd =  950 ;    } ; # fin de si
00104        if (
$xmp==12){       $na =    ;       $nb =  950 ;       $nc =   50 ;       $nd =    ;    } ; # fin de si
00105        if (
$xmp==13){       $na =   25 ;       $nb =  475 ;       $nc =   25 ;       $nd =  475 ;    } ; # fin de si
00106        if (
$xmp==14){       $na =  500 ;       $nb =    ;       $nc =    ;       $nd =  500 ;    } ; # fin de si
00107        if (
$xmp==15){       $na =    ;       $nb =  500 ;       $nc =  500 ;       $nd =    ;    } ; # fin de si
00108        if (
$xmp==16){       $na =  250 ;       $nb =  250 ;       $nc =  250 ;       $nd =  250 ;    } ; # fin de si
00109        if (
$xmp==17){       $na =  950 ;       $nb =    ;       $nc =    ;       $nd =   50 ;    } ; # fin de si
00110        if (
$xmp==18){       $na =    ;       $nb =   50 ;       $nc =  950 ;       $nd =    ;    } ; # fin de si
00111        if (
$xmp==19){       $na =  475 ;       $nb =   25 ;       $nc =  475 ;       $nd =   25 ;    } ; # fin de si
00112     
00113        if (
$xmp==20){       $na =  250 ;       $nb =    ;       $nc =   50 ;       $nd =  700 ;    } ; # fin de si
00114        if (
$xmp==21){       $na =  260 ;       $nb =   10 ;       $nc =   40 ;       $nd =  690 ;    } ; # fin de si
00115        if (
$xmp==22){       $na =  280 ;       $nb =   30 ;       $nc =   20 ;       $nd =  670 ;    } ; # fin de si
00116        if (
$xmp==23){       $na =  300 ;       $nb =   50 ;       $nc =    ;       $nd =  650 ;    } ; # fin de si
00117     
00118        if (
$xmp==24){       $na =  650 ;       $nb =    ;       $nc =   50 ;       $nd =  300 ;    } ; # fin de si
00119        if (
$xmp==25){       $na =  670 ;       $nb =   20 ;       $nc =   30 ;       $nd =  280 ;    } ; # fin de si
00120        if (
$xmp==26){       $na =  690 ;       $nb =   40 ;       $nc =   10 ;       $nd =  260 ;    } ; # fin de si
00121        if (
$xmp==27){       $na =  700 ;       $nb =   50 ;       $nc =    ;       $nd =  250 ;    } ; # fin de si
00122     
00123     /* echo "<pre> fin de function donneesXmp NA $na </pre>\n" ; */
00124     
00125     
# fin de function donneesXmp
00126     
00127     #########################################################
00128     #########################################################
00129     
00130     function 
trtd($opt="") { tr() ; td($opt) ; } ;
00131     function fintdtr
() { fintd() ; fintr() ; } ;
00132     function fintdtd
($opt="") { fintd() ; td($opt) ; } ;
00133     
00134     function ligneFV
($m1,$m2) {
00135       trtd
("C") ; nbsp(3) ; echo $m1 " ;  nbsp(3) ; fintdtd("C") ; nbsp(3) ; echo $m2 "  nbsp(3) ; fintdtr() ;
00136     } # fin de fonction ligne FV
00137     
00138     #########################################################
00139     #########################################################
00140     
00141     function 
tableDonnees() { global $mf$na$nb$nc$nd$nab$nac$nbd$ncd$nad$xmp$txmp ;
00142     
00143     #########################################################
00144     
00145     /* echo "<pre> NA $na </pre>\n" ; */
00146     
00147        if (
$mf==1) {
00148           echo "<form action=\"vd.php\" method=\"post\" >" 
;
00149           echo "<input type='hidden' name='txmp' value='"
.$xmp."' />\n" ;
00150        } ; # fin de si
00151     
00152        table
() ;
00153        trtd
() ;
00154     
00155           if ($mf
==1) { affTable(-1) ; } else { affTable(0) ; } ;
00156     
00157        fintdtd
() ;
00158     
00159        nbsp
(10) ;
00160        fintd
() ;
00161     
00162        echo "<td valign=\"middle\" >" 
;
00163           table
() ;
00164           trtd
() ;    nbsp() ;    fintdtr() ;
00165           trtd
() ;
00166              table
(1,2) ;
00167                 ligneFV
("Vrais +","Faux  +") ;
00168                 ligneFV
("Faux  -","Vrais -") ;
00169              fintable
() ;
00170           fintdtr
() ;
00171           fintable
() ;
00172     
00173        fintdtr
() ;
00174        fintable
() ;
00175        br
() ;
00176     
00177        p
() ;
00178        nbsp
() ;
00179        if ($mf
==1) {
00180             nbsp
(8) ;
00181             echo '<input type="submit" value="Envoyer" name="exec" class="vert_pastel" />' 
;
00182             nbsp
(8) ;
00183             echo '<input type="submit" value="Effacer tout" name="risette" class="orange_pastel" />' 
;
00184             nbsp
(3) ;
00185     
00186        } ; # fin de si
00187        finp
() ;
00188     
00189        if ($mf
==1) {
00190     
00191             finform
() ;
00192     
00193             nbsp
(10) ;
00194     
00195     
00196             echo '<form action="vd.php" method = "post">' 
;
00197             echo "<p><b>Exemples :</b></p>" 
;
00198             br
() ;
00199     
00200             table
() ;
00201             tr
() ;
00202             td
() ;
00203             nbsp
(8) ;
00204             echo '<input type="submit" name ="xmp1" value="&nbsp;&nbsp;&nbsp;&nbsp; Harvard &nbsp;&nbsp;&nbsp;&nbsp;" />' 
;
00205             fintd
() ;
00206     
00207             td
() ;
00208             nbsp
(8) ;
00209             echo '<input type="submit" name ="xmp2" value=" S7 "/>' 
;
00210             fintd
() ;
00211     
00212             td
() ;
00213             nbsp
(8) ;
00214             echo '<input type="submit" name ="xmp3" value=" S8 "/>' 
;
00215             fintd
() ;
00216     
00217             td
() ;
00218             nbsp
(8) ;
00219             echo '<input type="submit" name ="xmp4" value=" S817 "/>' 
;
00220             fintd
() ;
00221     
00222             fintr
() ;
00223     
00224             tr
() ;
00225             td
() ;
00226             nbsp
() ; br() ;
00227             fintd
() ;
00228             fintr
() ;
00229     
00230             tr
() ;
00231             td
() ;
00232             nbsp
(8) ;
00233             echo '<input type="submit" name ="xmp5" value=" SAS_Example "  />' 
;
00234             fintd
() ;
00235     
00236             td
() ;
00237             nbsp
(8) ;
00238             echo '<input type="submit" name ="xmp6" value=" Falissard "/>' 
;
00239             fintd
() ;
00240     
00241             td
() ;
00242             nbsp
(8) ;
00243             echo '<input type="submit" name ="xmp7" value=" H825 "/>' 
;
00244             fintd
() ;
00245     
00246             td
() ;
00247             nbsp
(8) ;
00248             echo '<input type="submit" name ="xmp8" value=" F825 "/>' 
;
00249             fintd
() ;
00250             fintr
() ;
00251     
00252             tr
() ;
00253             td
() ;
00254             nbsp
() ; br() ;
00255             fintd
() ;
00256             fintr
() ;
00257     
00258             tr
() ;
00259             td
() ;
00260             nbsp
(8) ;
00261             echo '<input type="submit" name ="xmp9" value=" Bewick_1 "  />' 
;
00262             fintd
() ;
00263     
00264             td
() ;
00265             nbsp
(8) ;
00266             echo '<input type="submit" name ="xmp10" value=" Bewick_2 "/>' 
;
00267             fintd
() ;
00268     
00269     
00270             fintr
() ;
00271             fintable
() ;
00272     
00273             finform
() ;
00274     
00275             br
() ;
00276             wrefs
() ;
00277     
00278        } ; # fin de si
00279     
00280     
# fin de fonction tableDonnees() ;
00281     
00282     #########################################################
00283     
00284     function 
wrefs() {
00285     
00286     #########################################################
00287     
00288     echo 
"<p><b>References</b></p>" ;
00289     
00290     p
() ;
00291     nbsp
(8) ;
00292     echo ancre
("http://support.sas.com/faq/041/FAQ04144.html","SAS proc Freq to produce PV") ;
00293     finp
() ;
00294     
00295     p
() ;
00296     nbsp
(8) ;
00297     echo ancre
("http://www.kb.u-psud.fr/acces-etudiant/cours/biostat/html/Syntaxe%20et%20listings%20CUSSV/html/lestimation.htm","Exemples Falissard") ;
00298     finp
() ;
00299     
00300     p
() ;
00301     nbsp
(8) ;
00302     echo ancre
("http://gim.unmc.edu/dxtests/Default.htm","Predictive values and ROC Curves") ;
00303     finp
() ;
00304     
00305     p
() ;
00306     nbsp
(8) ;
00307     echo ancre
("http://ccforum.com/content/8/6/508","Bewick (Critical Care, statistics review 13)") ;
00308     nbsp
(8) ;
00309     echo ancre
("http://ccforum.com/content/pdf/cc3000.pdf","version PDF") ;
00310     
00311     finp
() ;
00312     
00313     br
() ;
00314     echo "<p><b>Pr&eacute;cautions d'emploi</b></p>" 
;
00315     br
() ;
00316     
00317     ?>
00318     <p>
00319     Comme le montrent les exemples Bewick_1 et Bewick_2, pour une m&ecirc;me valeur
00320     de SENS et SPEC, si la pr&eacute;valence augmente, la VPP augmente et la VPN diminue.
00321     </p>
00322     
00323     <p>
00324     Plus la valeur de PLR est grande, meilleur est le test.
00325     </p>
00326     
00327     <p>
00328     Plus l'indice de Youden se rapproche de 1, meilleur est le test.
00329     </p>
00330     
00331     <p>
00332     Voici des <span class="gbleu">cas limites</span> avec <b>1000</b> individus pour mieux comprendre ces indices
00333     </p>
00334     
00335     <blockquote>
00336     <form action="vd.php" method = "post">
00337     <table summary="formulaire">
00338     <tr>
00339     <td height="50">
00340     Faible pr&eacute;valence
00341     </td>
00342     <td>
00343     <input type="submit" name ="xmp11" value=" 100 % de bien class&eacute;s " />
00344     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
00345     <input type="submit" name ="xmp12" value="  0 % de bien class&eacute;s " />
00346     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
00347     <input type="submit" name ="xmp13" value="  &eacute;quir&eacute;partition " class="jaune_pastel" />
00348     </td>
00349     </tr>
00350     <tr>
00351     <td height="50">
00352     Pr&eacute;valence moyenne
00353     </td>
00354     <td>
00355     <input type="submit" name ="xmp14" value=" 100 % de bien class&eacute;s " />
00356     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
00357     <input type="submit" name ="xmp15" value="  0 % de bien class&eacute;s " />
00358     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
00359     <input type="submit" name ="xmp16" value="  &eacute;quir&eacute;partition " class="jaune_pastel" />
00360     </td>
00361     </tr>
00362     <tr>
00363     <td  height="50">
00364     Forte pr&eacute;valence
00365     </td>
00366     <td>
00367     <input type="submit" name ="xmp17" value=" 100 % de bien class&eacute;s " />
00368     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
00369     <input type="submit" name ="xmp18" value="  0 % de bien class&eacute;s " />
00370     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
00371     <input type="submit" name ="xmp19" value="  &eacute;quir&eacute;partition " class="jaune_pastel" />
00372     </td>
00373     </tr>
00374     </table>
00375     </form>
00376     </blockquote>
00377     
00378     <p class="aligne">
00379     On se m&eacute;fiera de la VPG qui peut correspondre &agrave; des <span class="grouge">indices de Youden</span> diff&eacute;rents
00380     pour divers tests appliqu&eacute;s &agrave; une  <span class="grouge">m&ecirc;me population</span> (m&ecirc;me pr&eacute;valence)
00381     car pour un m&ecirc;me nombre total de bien class&eacute;s l'indice de Youden augmente avec la VPP en cas
00382     de forte pr&eacute;valence de la maladie alors qu'il augmente avec la VPN en cas de faible pr&eacute;valence.
00383     <span class="gbleu">Ici, dans tous les cas, la VPG (ou OA, Overall Accuracy) est de 95 %</span>.
00384     <br />
00385     &nbsp;
00386     </p>
00387     
00388     <blockquote>
00389     <form action="vd.php" method = "post">
00390     <table border="1" summary="t1">
00391     <tr>
00392     
00393     <td>
00394     <br />
00395     &nbsp;&nbsp;
00396     <span class="gvert">Faible pr&eacute;valence </span> (30 %)<br/>
00397     <table summary="t2">
00398     <tr>
00399     
00400     <td height="50">&nbsp;&nbsp;VPP &agrave; 100 % VPN  93 %</td>
00401     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00402     <td><input type="submit" name ="xmp20" value=" Youden 0.83 "/>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
00403     
00404     <tr><td height="50">&nbsp;&nbsp;VPP &agrave;  96 % VPN  95 %</td>
00405     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00406     <td><input type="submit" name ="xmp21" value=" Youden 0.85 "/>&nbsp;&nbsp;</td></tr>
00407     
00408     <tr><td height="50">&nbsp;&nbsp;VVPP &agrave;  90 % VPN  97 %</td>
00409     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00410     <td><input type="submit" name ="xmp22" value=" Youden 0.89 "/>&nbsp;&nbsp;</td></tr>
00411     
00412     <tr><td height="50">&nbsp;&nbsp;VPP &agrave;  86 % VPN 100 %</td>
00413     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00414     <td><input type="submit" name ="xmp23" value=" Youden 0.93 "/>&nbsp;&nbsp;</td></tr>
00415     </table>
00416     </td>
00417     
00418     <td>
00419     <br />
00420     &nbsp;&nbsp;
00421     <span class="gvert">Forte pr&eacute;valence</span> (70 %)<br />
00422     <table  summary="t3">
00423     <tr>
00424     <td height="50">&nbsp;&nbsp;VPP &agrave; 100 % VPN  86 %</td>
00425     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00426     <td><input type="submit" name ="xmp24" value=" Youden 0.93 "/>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
00427     
00428     <tr><td height="50">&nbsp;&nbsp;VPP &agrave;  97 % VPN  90 %</td>
00429     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00430     <td><input type="submit" name ="xmp25" value=" Youden 0.89 "/>&nbsp;&nbsp;</td></tr>
00431     
00432     <tr><td height="50">&nbsp;&nbsp;VPP &agrave;  95 % VPN  96 %</td>
00433     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00434     <td><input type="submit" name ="xmp26" value=" Youden 0.85 "/>&nbsp;&nbsp;</td></tr>
00435     
00436     <tr><td height="50">&nbsp;&nbsp;VPP &agrave;  93 % VPN 100 %</td>
00437     <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
00438     <td><input type="submit" name ="xmp27" value=" Youden 0.83 "/>&nbsp;&nbsp;</td></tr>
00439     
00440     </table>
00441     </td>
00442     
00443     </tr>
00444     </table>
00445     
00446     </form>
00447     </blockquote>
00448     
00449     <?php
00450     
00451     
# fin de fonction wrefs
00452     
00453     #########################################################
00454     
00455     function 
tr5tdCarac($court,$nom,$fval,$pct,$autre="") {
00456     
00457     #########################################################
00458     
00459         trtd
("L") ;
00460             echo $court 
;
00461             nbsp
(3) ;
00462         fintdtd
() ;
00463         echo '<font color="#000088">'
.$nom.'</font>' ;
00464         fintdtd
() ;
00465         nbsp
(3) ;
00466         echo " : " 
;
00467         nbsp
(3) ;
00468         fintdtd
("R") ;
00469         if ($pct
=="%") {
00470            if ($fval
==" NaN ") {
00471                echo( $fval 
) ;
00472            } else {
00473                echo sprintf
("%8.2f",$fval) ;
00474            } ; # finsi
00475            nbsp
() ;
00476            fintdtd
() ;
00477            nbsp
(2) ;
00478            echo "%" 
;
00479         } else {
00480            if ($fval
==" NaN ") {
00481                echo( $fval 
) ;
00482            } else {
00483                echo sprintf
("%7.3f",$fval) ;
00484            } ; # finsi
00485            fintdtd
() ;
00486            nbsp
(2) ;
00487         } ; # fin de si
00488         if (
strlen(trim($autre))>0) {
00489            nbsp
(2) ;
00490            echo $autre 
;
00491            nbsp
(2) ;
00492         } ; # fin de si
00493         fintdtr
() ;
00494     
00495     } # fin de fonction tr5tdCarac
00496     
00497     #########################################################
00498     
00499     function 
tableCaracteristiques() { global $mf$na$nb$nc$nd$nab$nac$nbd$ncd$nad ;
00500     
00501     #########################################################
00502     
00503     $sensi 
$na/$nac ;
00504     $speci 
$nd/$nbd ;
00505     $bmc   
$nb-$nc ;
00506     
00507     blockquote
() ;
00508     echo "\n" 
;
00509     table
() ;
00510     
00511       tr5tdCarac
(" SENS "," Sensibilit&eacute; "                      ,100*$sensi,"%") ;
00512       tr5tdCarac
(" SPEC "," Sp&eacute;cificit&eacute; "               ,100*$speci,"%") ;
00513       if ($nab
>0) {
00514          tr5tdCarac
(" VPP  "," Valeur pr&eacute;dictive positive "       ,100*$na/$nab,"%") ;
00515       } else {
00516          tr5tdCarac
(" VPP  "," Valeur pr&eacute;dictive positive "       ," NaN ","%") ;
00517       } ; # fin de si
00518     
00519       if (
$ncd>0) {
00520          tr5tdCarac
(" VPN  "," Valeur pr&eacute;dictive n&eacute;gative ",100*$nd/$ncd,"%") ;
00521       } else {
00522          tr5tdCarac
(" VPN  "," Valeur pr&eacute;dictive n&eacute;gative "," NaN ","%") ;
00523       } ; # fin de si
00524     
00525       tr5tdCarac
(" VPG  "," Valeur pr&eacute;dictive globale "        ,100*($na+$nd)/($nab+$ncd),"%","(pourcentage global de bien class&eacute;s)") ;
00526       tr5tdCarac
(" PR   ""Pr&eacute;valence                       " ,100*($na+$nc)/($nab+$ncd),"%") ;
00527     
00528       echo "<tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr>\n" 
;
00529     
00530       if (($ncd
>0) and($nab>0) and($nc>0)) {
00531          tr5tdCarac
(" RR   "," Risque relatif  "                         ,($na/$nab)/($nc/$ncd),"") ;
00532       } else {
00533          tr5tdCarac
(" RR   "," Risque relatif  "                         ," NaN ","") ;
00534       } ; # fin de si
00535     
00536     /*
00537       tr5tdCarac(" RRR  "," R&eacute;duction de risque relatif  "     ,($na/$nab)/($nc/$ncd),"") ;
00538       tr5tdCarac(" NNT  "," Nombre n&eacute;cessaire pour traitement "       ,($na/$nab)/($nc/$ncd),"") ;
00539     */
00540     
00541       if ((
$nb>0) and($nd>0) and($nc>0)) {
00542          tr5tdCarac
(" OR   "," Rapport de cotes (Psi)"                   ,($na/$nb)/($nc/$nd),"") ;
00543       } else {
00544          tr5tdCarac
(" OR   "," Rapport de cotes (Psi)"                   ," NaN ","") ;
00545       } ; # fin de si
00546     
00547       if (
$speci==1) {
00548          tr5tdCarac
(" PLR  ""Positive Likelihood ratio "               ," NaN ","") ;
00549       } else {
00550          tr5tdCarac
(" PLR  ""Positive Likelihood ratio "               ,$sensi/(1-$speci),"") ;
00551       } ; # finsi
00552     
00553       if (
$speci==0) {
00554         tr5tdCarac
(" NLR  ""Negative Likelihood ratio "               ," NaN ","") ;
00555       } else {
00556         tr5tdCarac
(" NLR  ""Negative Likelihood ratio "               ,(1-$sensi)/$speci,"") ;
00557       } ; # finsi
00558     
00559       tr5tdCarac
(" IY   ""Indice J de Youden                      " ,$sensi+$speci-1,"") ;
00560       tr5tdCarac
(" CQ   ""Coefficient Q (Yule)                    " ,($na*$nd-$nb*$nc)/($na*$nd+$nb*$nc),"") ;
00561       tr5tdCarac
(" K    ""Kappa (Cohen)                           " ,2*($na*$nd-$nb*$nc)/($nab*$nbd+$nac*$ncd),"") ;
00562     
00563       if (($nb
+$nc)==0) {
00564         tr5tdCarac
(" MN   ""Mc Nemar                                " ," NaN ","") ;
00565       } else {
00566         tr5tdCarac
(" MN   ""Mc Nemar                                " ,$bmc*$bmc/($nb+$nc),"") ;
00567       } ; # finsi
00568     
00569       tr5tdCarac
(" F1  "," Score F1 " ,2*$na/(2*$na $nb $nc ),"") ;
00570       $href_mcc  
"https://en.wikipedia.org/wiki/Matthews_correlation_coefficient" ;
00571       $mcc 
= ($na*$nd $nb*$nc) / sqrt( ($na+$nb)*($na+$nc) *($nd+$nb)*($nd+$nc)) ;
00572       tr5tdCarac
(" MCC ",href($href_mcc," Matthews correlation coefficient ") ,$mcc,"") ;
00573     
00574     fintable
() ;
00575     finblockquote
() ;
00576     
00577     nbsp
() ;
00578     
00579     } # fin de fonction tableCaracteristiques
00580     
00581     #########################################################
00582     
00583     function 
tr4($a,$b,$c,$d) {
00584     
00585     tr
() ;
00586     td
() ; nbsp(3) ; echo $a nbsp(3) ; fintd() ;
00587     td
() ; nbsp(3) ; echo $b nbsp(3) ; fintd() ;
00588     td
() ; nbsp(3) ; echo $c nbsp(3) ; fintd() ;
00589     td
() ; nbsp(3) ; echo $d nbsp(3) ; fintd() ;
00590     fintr
() ;
00591     
00592     } # fin fonction
00593     
00594     #########################################################
00595     
00596     function 
tableProbas() { global $na$nb$nc$nd ;
00597     
00598     #########################################################
00599     
00600     blockquote
() ;
00601     
00602     h3
("Probabilit&eacute;s associ&eacute;es") ;
00603     
00604     table
(1,10,"collapse","t4") ;
00605     entetesTableau
("Package Calcul Valeur p-value") ;
00606     
00607     $tcmdR 
= array() ;
00608     $nbcmd 
= -;
00609     
00610     $nbcmd
++ ; $tcmdR[$nbcmd] = "  library(lpSolve,lib.loc='../rpkgs')\n  " ;
00611     $nbcmd
++ ; $tcmdR[$nbcmd] = "  library(irr,lib.loc='../rpkgs')\n  " ;
00612     #$nbcmd++ ; $tcmdR[$nbcmd] = "  library(concord)\n " ;
00613     $nbcmd
++ ; $tcmdR[$nbcmd] = "  " ;
00614     
00615     $nbcmd
++ ; $tcmdR[$nbcmd] = "######################################### " ;
00616     $nbcmd
++ ; $tcmdR[$nbcmd] = " " ;
00617     $nbcmd
++ ; $tcmdR[$nbcmd] = "abcd2t <- function(a,b,c,d) { " ;
00618     $nbcmd
++ ; $tcmdR[$nbcmd] = "  n   <- a+b+c+d " ;
00619     $nbcmd
++ ; $tcmdR[$nbcmd] = "  trd <- matrix(nrow=n,ncol=2) " ;
00620     $nbcmd
++ ; $tcmdR[$nbcmd] = "  trd[(1:(a+b)),1] <- 1 " ;
00621     $nbcmd
++ ; $tcmdR[$nbcmd] = "  trd[(1:a),2]     <- 1 " ;
00622     $nbcmd
++ ; $tcmdR[$nbcmd] = "  trd[((a+1):(a+b)),2] <- 0 " ;
00623     $nbcmd
++ ; $tcmdR[$nbcmd] = "  trd[((a+b+1):n),1]  <- 0 " ;
00624     $nbcmd
++ ; $tcmdR[$nbcmd] = "  trd[((a+b+1):(a+b+c)),2]  <- 1 " ;
00625     $nbcmd
++ ; $tcmdR[$nbcmd] = "  trd[((a+b+c+1):n),2]  <- 0  " ;
00626     $nbcmd
++ ; $tcmdR[$nbcmd] = "  return(trd) " ;
00627     $nbcmd
++ ; $tcmdR[$nbcmd] = "} ; # fin fonction abcd2t " ;
00628     $nbcmd
++ ; $tcmdR[$nbcmd] = " " ;
00629     $nbcmd
++ ; $tcmdR[$nbcmd] = "######################################### " ;
00630     $nbcmd
++ ; $tcmdR[$nbcmd] = "  " ;
00631     
00632     $nbcmd
++ ; $tcmdR[$nbcmd] = "kap <- function(a,b,c,d) { " ;
00633     $nbcmd
++ ; $tcmdR[$nbcmd] = "  rdk <- kappa2( abcd2t(a,b,c,d) ) " ;
00634     #$nbcmd++ ; $tcmdR[$nbcmd] = "  cat('irr ',' ','kappa',rdk\$value,' ',rdk\$p.value,'\n') " ;
00635     $nbcmd
++ ; $tcmdR[$nbcmd] = "  cat(paste('<','tr>\\n',sep='')) " ;
00636     $nbcmd
++ ; $tcmdR[$nbcmd] = "  cat(paste('<','td align=\'left\'>&nbsp;&nbsp;&nbsp;irr&nbsp;&nbsp;&nbsp;<','/td>\\n',sep='')) " ;
00637     $nbcmd
++ ; $tcmdR[$nbcmd] = "  cat(paste('<','td align=\'left\'>&nbsp;&nbsp;&nbsp;kappa&nbsp;&nbsp;&nbsp;<','/td>\\n',sep='')) " ;
00638     $nbcmd
++ ; $tcmdR[$nbcmd] = "  cat(paste('<','td align=\'left\'>&nbsp;&nbsp;&nbsp;',sprintf(\"%6.3f\",rdk\$value),'&nbsp;&nbsp;&nbsp;<','/td>\\n',sep='')) " ;
00639     $nbcmd
++ ; $tcmdR[$nbcmd] = "  cat(paste('<','td align=\'left\'>&nbsp;&nbsp;&nbsp;',sprintf(\"%6.3f\",rdk\$p.value),'&nbsp;&nbsp;&nbsp;<','/td>\\n',sep='')) " ;
00640     $nbcmd
++ ; $tcmdR[$nbcmd] = "  cat(paste('<','/tr>\\n',sep='')) " ;
00641     $nbcmd
++ ; $tcmdR[$nbcmd] = "} ; # fin de fonction kap " ;
00642     
00643     $nbcmd
++ ; $tcmdR[$nbcmd] = " " ;
00644     $nbcmd
++ ; $tcmdR[$nbcmd] = "######################################### " ;
00645     $nbcmd
++ ; $tcmdR[$nbcmd] = " " ;
00646     
00647     /*
00648     $nbcmd++ ; $tcmdR[$nbcmd] = "mcn <- function(a,b,c,d) { " ;
00649     $nbcmd++ ; $tcmdR[$nbcmd] = "  rdm <- mcnemar.mh( cbind( c(d,c), c(b,a) ) ) " ;
00650     #$nbcmd++ ; $tcmdR[$nbcmd] = "  cat('concord ',' ','mac nemar',rdm\$statistic,' ',rdm\$p,'\n')  " ;
00651     $nbcmd++ ; $tcmdR[$nbcmd] = "  cat('<tr>\n') " ;
00652     $nbcmd++ ; $tcmdR[$nbcmd] = "  cat(\"<td align='left'>&nbsp;&nbsp;&nbsp;concord&nbsp;&nbsp;&nbsp;</td>\",'\n') " ;
00653     $nbcmd++ ; $tcmdR[$nbcmd] = "  cat(\"<td align='left'>&nbsp;&nbsp;&nbsp;mac nemar&nbsp;&nbsp;&nbsp;</td>  \",'\n') " ;
00654     $nbcmd++ ; $tcmdR[$nbcmd] = "  cat(\"<td align='left'>&nbsp;&nbsp;&nbsp;\",rdm\$statistic,\"&nbsp;&nbsp;&nbsp;</td>\",'\n') " ;
00655     $nbcmd++ ; $tcmdR[$nbcmd] = "  cat(\"<td align='left'>&nbsp;&nbsp;&nbsp;\",rdm\$p,\"&nbsp;&nbsp;&nbsp;</td>\",'\n') " ;
00656     $nbcmd++ ; $tcmdR[$nbcmd] = "  cat('</tr>\n') " ;
00657     $nbcmd++ ; $tcmdR[$nbcmd] = "} ; # fin de fonction mcnemar.mh " ;
00658     */
00659     
00660     $nbcmd
++ ; $tcmdR[$nbcmd] = " " ;
00661     $nbcmd
++ ; $tcmdR[$nbcmd] = "######################################### " ;
00662     $nbcmd
++ ; $tcmdR[$nbcmd] = "######################################### " ;
00663     $nbcmd
++ ; $tcmdR[$nbcmd] = " " ;
00664     $nbcmd
++ ; $tcmdR[$nbcmd] = "cat(\"STAT_DEB\\n\") " ;
00665     
00666     $nbcmd
++ ; $tcmdR[$nbcmd] = "kap($na,$nb,$nc,$nd) " ;
00667     
00668     /*
00669     $nbcmd++ ; $tcmdR[$nbcmd] = "mcn($na,$nb,$nc,$nd) " ;
00670     $nbcmd++ ; $tcmdR[$nbcmd] = " " ;
00671     */
00672     
00673     $nbcmd
++ ; $tcmdR[$nbcmd] = "cat(\"STAT_FIN\\n\") " ;
00674     
00675     /*
00676     pre("cadre") ;
00677     print_R($tcmdR) ;
00678     finpre() ;
00679     */
00680     
00681     /*
00682     pre("cadre") ;
00683     finpre() ;
00684     */
00685     
00686     execute_R
($tcmdR,0) ;
00687     
00688     fintable
() ;
00689     
00690     
00691     finblockquote
() ;
00692     
00693     } # fin de fonction tableProbas
00694     
00695     #########################################################
00696     
00697     function 
colTable($nbs,$mot) {
00698     
00699     #########################################################
00700     
00701       td
("C") ;
00702         nbsp
(1) ;
00703         echo  
$mot " ;
00704         nbsp
(1) ;
00705       fintd
() ;
00706     
00707     } # fin fonction colTable
00708     
00709     #########################################################
00710     
00711     function 
affTable($mt=0) { global $mf$na$nb$nc$nd$nab$nac$nbd$ncd$nad,$xmp ;
00712     
00713     #########################################################
00714     
00715        $ntg 
$nab $ncd # total g&eacute;n&eacute;ral
00716     
00717        table
(1,5,"collapse") ;
00718     
00719        trtd
() ;
00720              nbsp
() ;
00721              if ($mt
<0) {
00722                 echo "<input type=\"hidden\" name=\"mf\" value=\"0\" />" 
;
00723              } else {
00724                nbsp
() ;
00725              } ; # fin si
00726           fintd
() ;
00727           colTable
(1,"Malades") ;
00728           colTable
(1,"Non-malades") ;
00729           if ($mt
==1) { colTable(2,"Total ligne") ; colTable(2,"% du total g&eacute;n&eacute;ral ") ;} ; # fin si
00730           if (
$mt==5) { colTable(2,"Au total") ;    } ; # fin si
00731        fintr
() ;
00732     
00733        trtd
() ;
00734              if ($mt
<5) {
00735                 nbsp
(3) ;
00736                 echo "Signes pr&eacute;sents (test positif)" 
;
00737                 nbsp
(3) ;
00738              } else {
00739                 nbsp
(3) ;
00740                 echo "Nombre BC " 
;
00741                 nbsp
(3) ;
00742              } ; # fin si
00743           fintd
() ;
00744           if ($mt
<0) {
00745              td
("C") ;
00746                 nbsp
(2) ;
00747                 $vna 
"" ;
00748                 if (($na
>=0) and (!$xmp==0)) { $vna"     ".sprintf("%9d",$na)."  " ; } ;
00749                 echo "<input type=\"text\" name=\"Na\" size=\"8\" value=\"
$vna\" />" ;
00750                 nbsp
(2) ;
00751              fintd
() ;
00752              td
("C") ;
00753                 nbsp
(2) ;
00754                 $vnb 
"" ;
00755                 if (($nb
>=0) and (!$xmp==0)) { $vnb"     ".sprintf("%9d",$nb)."  " ; } ;
00756                 echo "<input type=\"text\" name=\"Nb\" size=\"8\" value=\"
$vnb\" />" ;
00757                 nbsp
(2) ;
00758              fintd
() ;
00759           } else {
00760              td
("R") ;
00761                 nbsp
(3) ;
00762                 if ($mt
<=1) { $deb =  sprintf("%8d",$na) ; } ;
00763                 if ($mt
==2) { $deb =  sprintf("%8.2f",100*$na/$nab) ; } ;
00764                 if ($mt
==3) { $deb =  sprintf("%8.2f",100*$na/$nac) ; } ;
00765                 if ($mt
==4) { $deb =  sprintf("%8.2f",100*$na/$ntg) ; } ;
00766                 if ($mt
==5) { $deb =  sprintf("%8d",$na) ; } ;
00767                 echo $deb 
nbsp(8) ;
00768              fintd
() ;
00769              td
("R") ;
00770                 nbsp
(3) ;
00771                 if ($mt
<=1) { $deb =  sprintf("%8d",$nb) ; } ;
00772                 if ($mt
==2) { $deb =  sprintf("%8.2f",100*$nb/$nab) ; } ;
00773                 if ($mt
==3) { $deb =  sprintf("%8.2f",100*$nb/$nbd) ; } ;
00774                 if ($mt
==4) { $deb =  sprintf("%8.2f",100*$nb/$ntg) ; } ;
00775                 if ($mt
==5) { $deb =  sprintf("%8d",$nd) ; } ;
00776                 echo $deb 
nbsp(8) ;
00777              fintd
() ;
00778           } ; # fin si
00779           if (
$mt==1) {
00780              td
("R") ;
00781                 echo s_span
(sprintf("%8d",$nab),"gvert") ; nbsp(8) ;
00782              fintd
() ;
00783              td
("R") ;
00784                 echo sprintf
("%8.2f",100*$nab/$ntg) ; nbsp(3) ;
00785              fintd
() ;
00786           } ; # fin si
00787           if (
$mt==5) {
00788              td
("R") ;
00789                 echo s_span
(sprintf("%8d",$nad),"gvert") ; nbsp(8) ;
00790              fintd
() ;
00791           } ; # fin si
00792        fintr
() ;
00793     
00794        tr
() ;
00795           td
() ;
00796              if ($mt
<5) {
00797                 nbsp
(3) ;
00798                 echo "Signes absents (test n&eacute;gatif)" 
;
00799                 nbsp
(3) ;
00800              } else {
00801                 nbsp
(3) ;
00802                 echo "Population " 
;
00803                 nbsp
(3) ;
00804              } ; # fin si
00805           fintd
() ;
00806           if ($mt
<0) {
00807              td
("C") ;
00808                 nbsp
(2) ;
00809                 $vnc 
"" ;
00810                 if (($nc
>=0) and (!$xmp==0)) { $vnc"     ".sprintf("%9d",$nc)."  " ; } ;
00811                 echo "<input type=\"text\" name=\"Nc\" size=\"8\" value=\"
$vnc\" />" ;
00812              fintd
() ;
00813              td
("C") ;
00814                 nbsp
(2) ;
00815                 $vnd 
"" ;
00816                 if (($nd
>=0) and (!$xmp==0)) { $vnd"     ".sprintf("%9d",$nd)."  " ; } ;
00817                 echo "<input type=\"text\" name=\"Nd\" size=\"8\" value=\"
$vnd\" />" ;
00818              fintd
() ;
00819           } else {
00820                 td
("R") ;
00821                    nbsp
(3) ;
00822                    if ($mt
<=1) { $deb =  sprintf("%8d",$nc) ; } ;
00823                    if ($mt
==2) { $deb =  sprintf("%8.2f",100*$nc/$ncd) ; } ;
00824                    if ($mt
==3) { $deb =  sprintf("%8.2f",100*$nc/$nac) ; } ;
00825                    if ($mt
==4) { $deb =  sprintf("%8.2f",100*$nc/$ntg) ; } ;
00826                    if ($mt
==5) { $deb =  sprintf("%8d",$nac) ; } ;
00827                    echo $deb 
nbsp(8) ;
00828                 fintd
() ;
00829                 td
("R") ;
00830                    nbsp
(3) ;
00831                    if ($mt
<=1) { $deb =  sprintf("%8d",$nd) ; } ;
00832                    if ($mt
==2) { $deb =  sprintf("%8.2f",100*$nd/$ncd) ; } ;
00833                    if ($mt
==3) { $deb =  sprintf("%8.2f",100*$nd/$nbd) ; } ;
00834                    if ($mt
==4) { $deb =  sprintf("%8.2f",100*$nd/$ntg) ; } ;
00835                    if ($mt
==5) { $deb =  sprintf("%8d",$nbd) ; } ;
00836                    echo $deb 
nbsp(8) ;
00837                 fintd
() ;
00838           } ; # fin si
00839           if (
$mt==1) {
00840                 td
("R") ;
00841                    echo s_span
(sprintf("%8d",$ncd),"gvert") ; nbsp(8) ;
00842                 fintd
() ;
00843                 td
("R") ;
00844                    echo sprintf
("%8.2f",100*$ncd/$ntg) ; nbsp(3) ;
00845                 fintd
() ;
00846           } ; # fin si
00847           if (
$mt==5) {
00848                 td
("R") ;
00849                    echo s_span
(sprintf("%8d",$nac+$nbd),"grouge") ; nbsp(8) ;
00850                 fintd
() ;
00851           } ; # fin si
00852        fintr
() ;
00853        if ($mt
==1) {
00854           tr
() ;
00855                td
() ;
00856                 nbsp
(3) ;
00857                  echo "Total colonne " 
;
00858                 nbsp
(3) ;
00859                fintd
() ;
00860                td
("R") ;
00861                  echo  s_span
(sprintf("%8d",$nac),"gvert") ; nbsp(8) ;   ;
00862                fintd
() ;
00863                td
("R") ;
00864                  echo  s_span
(sprintf("%8d",$nbd),"gvert") ; nbsp(8) ;   ;
00865                fintd
() ;
00866                td
("R") ;
00867                  echo s_span
(sprintf("%8d",$nac+$nbd),"grouge") ; nbsp(8) ;   ;
00868                fintd
() ;
00869                td
("R") ;
00870                  echo sprintf
("%8.2f",100*($nac+$nbd)/$ntg) ; nbsp(3) ;   ;
00871                fintd
() ;
00872           fintr
() ;
00873           tr
() ;
00874                td
() ;
00875                 nbsp
(3) ;
00876                  echo "% du total g&eacute;n&eacute;ral " 
;
00877                 nbsp
(3) ;
00878                fintd
() ;
00879                td
("R") ;
00880                  nbsp
(3) ;
00881                  echo  sprintf
("%8.2f",100*$nac/$ntg) ; nbsp(8) ;   ;
00882                fintd
() ;
00883                td
("R") ;
00884                  nbsp
(3) ;
00885                  echo  sprintf
("%8.2f",100*$nbd/$ntg) ; nbsp(8) ;   ;
00886                fintd
() ;
00887                td
("R") ;
00888                  nbsp
(3) ;
00889                  echo  sprintf
("%8.2f",100*$ntg/$ntg) ; nbsp(8) ;   ;
00890                fintd
() ;
00891                td
("R") ;
00892                fintd
() ;
00893           fintr
() ;
00894        } ; # fin si
00895     
00896        if (
$mt==5) {
00897           tr
() ;
00898                td
() ;
00899                 nbsp
(3) ;
00900                  echo "Pourcentage BC " 
;
00901                 nbsp
(3) ;
00902                fintd
() ;
00903                td
("R") ;
00904                  nbsp
(3) ;
00905                  echo  sprintf
("%8.2f",100*$na/$nac) ; nbsp(8) ;   ;
00906                fintd
() ;
00907                td
("R") ;
00908                  nbsp
(3) ;
00909                  echo  sprintf
("%8.2f",100*$nd/$nbd) ; nbsp(8) ;   ;
00910                fintd
() ;
00911                td
("R") ;
00912                  nbsp
(3) ;
00913                  echo sprintf
("%8.2f",100*($na+$nd)/($nac+$nbd)) ; nbsp(8) ;   ;
00914                fintd
() ;
00915           fintr
() ;
00916        } ; # fin si
00917     
00918        fintable
() ;
00919     
00920     } # fin de fonction affTable
00921     
00922     #########################################################
00923     
00924     function 
srcVerif() { global $na$nb$nc$nd ;
00925     
00926     #########################################################
00927     
00928     echo 
'<p class="texte">' ;
00929     echo " Si vous disposez de SAS, vous pouvez v&eacute;rifier ces calculs " 
;
00930     echo " et obtenir des compl&eacute;ments (Khi-2 de Mantel-Haenszel, Coefficient Phi, " 
;
00931     echo " Coefficient de contingence, V de Cramer, Gamma, Tau-b de Kendall, " 
;
00932     echo " Tau-c de Stuart, D de Somers...) en tapant " 
;
00933     finp
() ;
00934     
00935     echo '<textarea class="tajaunec" rows ="25" cols="90" >' 
;
00936     echo " \n" 
;
00937     echo "     options nodate linesize=132 pagesize=256 nocenter formdlim=' ' formchar='-----' ; \n" 
;
00938     echo " \n" 
;
00939     echo "     proc format ; \n" 
;
00940     echo "          value Fmaladie 1='Malades'  0='Non-malades'  ; \n" 
;
00941     echo "          value Fsigne   1='Pr&eacute;sents' 0='Non-pr&eacute;sents' ; \n" 
;
00942     echo " \n" 
;
00943     echo "     data vd ; \n" 
;
00944     echo "          input   signe maladie eff ; \n" 
;
00945     echo "          format  signe Fsigne. maladie Fmaladie. ; \n" 
;
00946     echo "          datalines ; \n" 
;
00947     echo "     1 1 "
.sprintf("%8d",$na)." \n" ;
00948     echo "     1 0 "
.sprintf("%8d",$nb)." \n" ;
00949     echo "     0 1 "
.sprintf("%8d",$nc)." \n" ;
00950     echo "     0 0 "
.sprintf("%8d",$nd)." \n" ;
00951     echo "     ; \n" 
;
00952     echo " \n" 
;
00953     echo "     proc freq data=vd order=data ; \n" 
;
00954     echo "          weight eff ; \n" 
;
00955     echo "          tables signe*maladie / chisq measures ; \n" 
;
00956     echo " \n" 
;
00957     echo "     run ; \n" 
;
00958     echo " \n" 
;
00959     echo '</textarea>' 
;
00960     
00961     p
() ;
00962     echo " Si vous disposez de R (et si vous avez install&eacute; le \"package\" rmeta), vous pouvez v&eacute;rifier " 
;
00963     echo " ces calculs en tapant " 
;
00964     finp
() ;
00965     
00966     $lprm 
sprintf("%6d",$na+$nc)." , ".sprintf("%6d",$nb+$nd)." , ".sprintf("%6d",$na)." , ".sprintf("%6d",$nb) ;
00967     
00968     echo '<textarea class="tajaunec" rows ="7" cols="90" >' 
;
00969     
00970     echo " \n" 
;
00971     echo "   library(rmeta) \n" 
;
00972     echo "   meta.MH( 
$lprm , statistic=\"OR\") \n" ;
00973     echo "   meta.MH( 
$lprm , statistic=\"RR\") \n" ;
00974     echo '</textarea>' 
;
00975     
00976     } # fin de fonction affTable
00977     
00978     #########################################################
00979     
00980     function 
formules() {
00981     
00982     #########################################################
00983     
00984     ?>
00985     <h3> Formules utilis&eacute;es </h3>
00986     
00987     <pre class="tagris">
00988     
00989         Donn&eacute;es
00990     
00991                                 Malades             Non-malades
00992            Signes pr&eacute;sents         Na  (VP)                Nb  (FP)
00993            Signes absents          Nc  (FN)                Nd  (VN)
00994     
00995     
00996         Caract&eacute;ristiques
00997     
00998             SENS    Sensibilit&eacute;                         Na / (Na + Nc)
00999             SPEC    Sp&eacute;cificit&eacute;                         Nd / (Nb + Nd)
01000             VPP     Valeur pr&eacute;dictive positive          Na / (Na + Nb)
01001             VPN     Valeur pr&eacute;dictive n&eacute;gative          Nd / (Nc + Nd)
01002             VPG     Valeur pr&eacute;dictive globale          (Na + Nd) / (Na + Nb + Nc + Nd)
01003             RR      Risque relatif                     (Na/(Na + Nb)) / (Nc/(Nc + Nd))
01004             OR      Rapport de cotes (Psi)             (Na/Nb) / (Nc/Nd)
01005             PLR     Positive likelihood ratio          (Na/(Na + Nc)) / (Nb/(Nb + Nd)) ou Sens / (1-Spec) &nbsp;&nbsp;
01006             NLR     Negative likelihood ratio          (Nc/(Na + Nc)) / (Nd/(Nb + Nd)) ou (1-Sens) / Spec
01007             PR      Pr&eacute;valence                         (Na +Nc) / (Na + Nb + Nc + Nd)
01008             IY      Indice de Youden                    Sens + Spec - 1
01009             CQ      Coefficient Q (Yule)               (Na*Nd - Nb*Nc)/(Na*Nd + Nb*Nc)
01010             Ka      Kappa (Cohen)                      2*(Na*Nd-Nb*Nc)/(Na+Nb*Nb*Nd+Na*Nc*Nc*Nd)
01011             MN      Mc Nemar                           (Nb-Nc)^2/(Nb+Nc)
01012             F1      Score F1                           2*Na/(2*Na + Nb + Nc )
01013             MCC     Coeff. corr. Matthews              (Na*Nd - Nb*Nc) / racine( (Na+Nb)*(Na+Nc)*(Nd+Nb)*(Nd+Nc) )
01014     
01015     
01016         Totaux
01017     
01018                                 Malades             Non-malades             Total ligne
01019            Signes pr&eacute;sents         Na                  Nb                     Na + Nb
01020            Signes absents          Nc                  Nd                     Nc + Nd
01021            Total colonne           Na + Nc             Nb + Nd                Nt = Na + Nb + Nc + Nd &nbsp;&nbsp;
01022     
01023     
01024         Pourcentages en ligne
01025     
01026                                 Malades             Non-malades
01027            Signes pr&eacute;sents         Na / (Na + Nb)      Nb / (Na + Nb)
01028            Signes absents          Nc / (Nc + Nd)      Nc / (Nc + Nd)
01029     
01030         Pourcentages en colonne
01031     
01032                                 Malades             Non-malades
01033            Signes pr&eacute;sents         Na / (Na + Nc)      Nb / (Na + Nd)
01034            Signes absents          Nc / (Na + nc)      Nd / (Nb + Nd)
01035     
01036         Pourcentages par rapport au total g&eacute;n&eacute;ral
01037     
01038                                 Malades             Non-malades
01039            Signes pr&eacute;sents         Na / Nt             Nb / Nt
01040            Signes absents          Nc / Nt             Nd / Nt
01041     
01042         Analyse des BC (biens class&eacute;s)
01043     
01044                                 Malades             Non-malades             Au total
01045            Nombre BC               Na                  Nd                      Na + Nd
01046            Population              Na + Nc             Nb + Nd                 Nt
01047            Pourcentage BC          Na / (Na + Nc)      Nd / (Nb + Nd)          (Na + Nd) / Nt
01048     
01049     
01050     </pre>
01051     
01052     <h3> Un peu de probabilit&eacute;s </h3>
01053     
01054     <pre class="tagris">
01055     
01056          Donn&eacute;es
01057     
01058                       M+    M-
01059                  S+   Na    Nb
01060                  S-   Nc    Nd
01061     
01062     
01063          Sensibilit&eacute; =  p( S+ | M+ )
01064          Sp&eacute;cificit&eacute; =  p( S- | M- )
01065          Vpp         =  p( M+ | S+ )
01066          Vpn         =  p( M- | S- )
01067          Pr&eacute;valence  =  p( M+ )
01068          Taux de faux n&eacute;gatifs =  p( S- | M+ )
01069          Taux de faux positifs =  p( S+ | M- )
01070     
01071     
01072     
01073     </pre>
01074     <?php
01075     
01076     
# fin de fonction formules
01077     
01078     
01079     #########################################################
01080     #########################################################
01081     
01082     debutPage
(" Valeur diagnostique (gH) version $versionVD")  ;
01083     debutSection
() ;
01084     
01085     /* r&eacute;cup&eacute;ration &eacute;ventuelle des donn&eacute;es */
01086     
01087     
01088     $txmp 
;
01089     $mf 
=  /* mode formulaire */
01090     if (isset(
$_POST["mf"])) { $mf $_POST["mf"] ; } ;
01091     if (isset($_POST
["txmp"]))    { $txmp $_POST["txmp"] ; } ;
01092     if (isset($_POST
["risette"])) { $xmp $txmp ; } ;
01093     
01094     $na 
= -;
01095     $nb 
= -;
01096     $nc 
= -;
01097     $nd 
= -;
01098     
01099     if (isset($_POST
["Na"])) { $na $_POST["Na"] ; } ;
01100     if (isset($_POST
["Nb"])) { $nb $_POST["Nb"] ; } ;
01101     if (isset($_POST
["Nc"])) { $nc $_POST["Nc"] ; } ;
01102     if (isset($_POST
["Nd"])) { $nd $_POST["Nd"] ; } ;
01103     $xmp 
;
01104     
01105     donneesXmp
() ;
01106     if (isset($_POST
["txmp"]))    { $txmp $_POST["txmp"] ; } ;
01107     if (isset($_POST
["risette"])) { $xmp $txmp ; } ;
01108     if ($txmp
>0) { $xmp $txmp ; } ;
01109     
01110     h1
("Etude de valeurs diagnostiques (gH) version $versionVD") ;
01111     $gh 
s_nbsp(20)." gilles.hunault \"at\" univ-angers.fr" ;
01112     h2
($gh,"gvert") ;
01113     blockquote
() ;
01114     
01115     #########################################################
01116     
01117     blockquote
() ;
01118     
01119     p
("texte") ;
01120       echo em
("Avant d'effectuer les calculs via ce formulaire, il est utile de lire ou de relire l'article ") ;
01121       $hrc 
"http://www.nature.com/nmeth/journal/v13/n8/full/nmeth.3945.html" ;
01122       echo em
(href($hrc,"classification evaluation")." paru dans ".b("Nature Methods")." en aout 2016.") ;
01123     finp
() ;
01124     p
("texte") ;
01125       echo em
("Une copie locale de ce court article (au format PDF) est ".href("nmeth.3945.pdf","ici").".") ;
01126     finp
() ;
01127     
01128     finblockquote
() ;
01129     
01130     #########################################################
01131     
01132     global 
$xmp ;
01133     $titreData 
"Donn&eacute;es " ;
01134     # if ( (is_numeric($xmp)) and ($xmp>0) ) { $titreData = " ; exemple $xmp " ; } ;
01135     if (
$xmp>0)  { if ($xmp<20) { $titreData .= " ; exemple $xmp " ; } ; } ;
01136     
01137     h2
($titreData) ;
01138     blockquote
() ;
01139     tableDonnees
() ;
01140     
01141     if ($mf
==0) {
01142     
01143        if (($na
=="") or ($na<0)) { $na ; echo " Vrais + mis &agrave; z&eacute;ro.<br />" ; } ;
01144        if (($nb
=="") or ($nb<0)) { $nb ; echo " Faux  + mis &agrave; z&eacute;ro.<br />" ; } ;
01145        if (($nc
=="") or ($nc<0)) { $nc ; echo " Faux  - mis &agrave; z&eacute;ro.<br />" ; } ;
01146        if (($nd
=="") or ($nd<0)) { $nd ; echo " Vrais - mis &agrave; z&eacute;ro.<br />" ; } ;
01147        $na 
intval($na) ;
01148        $nb 
intval($nb) ;
01149        $nc 
intval($nc) ;
01150        $nd 
intval($nd) ;
01151        $sn 
$na $nb $nc $nd ;
01152     
01153     if ($sn
<=0) {  echo "<br /><b> Donn&eacute;es insuffisantes pour continuer (total = $sn).</b> " ; } else {
01154     
01155           finblockquote
() ;
01156           h2
("R&eacute;sultats") ;
01157           blockquote
() ;
01158     
01159           $nab 
$na $nb ;
01160           $nac 
$na $nc ;
01161           $nbd 
$nb $nd ;
01162           $ncd 
$nc $nd ;
01163           $nad 
$na $nd ;
01164     
01165           h3
("Caract&eacute;ristiques") ;
01166     
01167           tableCaracteristiques
() ;
01168     
01169           # il vaut mieux que R &eacute;crive, si tout va bien...
01170           # h3("Probabilit&eacute;s associ&eacute;es") ;
01171     
01172           tableProbas
() ;
01173     
01174           h3
("Totaux") ;
01175     
01176           affTable
(1) ;
01177     
01178           h3
("Pourcentages en ligne") ;
01179     
01180           affTable
(2) ;
01181     
01182           h3
("Pourcentages en colonne") ;
01183     
01184           affTable
(3) ;
01185     
01186           h3
("Pourcentages par rapport au total g&eacute;n&eacute;ral") ;
01187     
01188           affTable
(4) ;
01189     
01190           h3
("Analyse des BC (biens class&eacute;s)") ;
01191     
01192           affTable
(5) ;
01193     
01194           h3
("V&eacute;rification logicielle et compl&eacute;ments") ;
01195     
01196           srcVerif
() ;
01197           formules
() ;
01198     
01199     } ; # fin de si sur sn
01200     } ; 
# fin de si sur mf
01201     
01202     
01203     finblockquote
() ;
01204     
01205     #########################################################
01206     
01207     pvide
() ;
01208     
01209     p
() ;
01210       echo href
("../montresource.php?nomfic=vd.php","Code-source de cette page","orange_stim nou") ;
01211     finp
() ;
01212     
01213     finblockquote
() ;
01214     
01215     finSection
() ;
01216     finPage
() ;
01217     ?>

Pour ne pas voir les numéros de ligne, ajoutez &nl=non à la suite du nom du fichier.

 

 

retour gH    Retour à la page principale de   (gH)