[Diagnosismed-commits] r11 - in pkg/DiagnosisMed: R chm man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 19 05:55:15 CEST 2009


Author: pedrobrasil
Date: 2009-04-19 05:55:15 +0200 (Sun, 19 Apr 2009)
New Revision: 11

Added:
   pkg/DiagnosisMed/R/TGROC.r
Modified:
   pkg/DiagnosisMed/R/LRgraph.r
   pkg/DiagnosisMed/R/print.ROC.r
   pkg/DiagnosisMed/R/print.diag.r
   pkg/DiagnosisMed/R/zzz.r
   pkg/DiagnosisMed/chm/00Index.html
   pkg/DiagnosisMed/chm/DiagnosisMed.hhp
   pkg/DiagnosisMed/chm/DiagnosisMed.toc
   pkg/DiagnosisMed/chm/ROC.html
   pkg/DiagnosisMed/chm/diagnosis.html
   pkg/DiagnosisMed/chm/interact.ROC.html
   pkg/DiagnosisMed/chm/plot.diag.html
   pkg/DiagnosisMed/man/LRgrgaph.Rd
   pkg/DiagnosisMed/man/ROC.Rd
   pkg/DiagnosisMed/man/TGROC.Rd
   pkg/DiagnosisMed/man/diagnosis.Rd
   pkg/DiagnosisMed/man/interact.ROC.Rd
   pkg/DiagnosisMed/man/plot.diag.Rd
Log:


Modified: pkg/DiagnosisMed/R/LRgraph.r
===================================================================
--- pkg/DiagnosisMed/R/LRgraph.r	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/R/LRgraph.r	2009-04-19 03:55:15 UTC (rev 11)
@@ -1,4 +1,4 @@
-LRgraph<-function(a=cbind(t1,t2),lwd=2,lty=1,cex=1,leg.cex=1.5,pt.cex=2){
+LRgraph<-function(a=cbind(t1,t2),lwd=2,lty=1,cex=1,leg.cex=1.5,pt.cex=2,...){
   plot(1-a[[6,1]],a[[4,1]],xlim=c(0,1),ylim=c(0,1),xlab="False positive rate",ylab="True positive rate",col=1,cex=cex,lwd=lwd,lty=lty)
   abline(coef=c(0,((a[[4,1]])/(1-a[[6,1]]))),lwd=lwd)
   abline(coef=c(1-1*((1-a[[4,1]])/(1-(1-a[[6,1]]))),(1-a[[4,1]])/(1-(1-a[[6,1]]))),lwd=lwd)

Added: pkg/DiagnosisMed/R/TGROC.r
===================================================================
--- pkg/DiagnosisMed/R/TGROC.r	                        (rev 0)
+++ pkg/DiagnosisMed/R/TGROC.r	2009-04-19 03:55:15 UTC (rev 11)
@@ -0,0 +1,158 @@
+TGROC<-function(gold,
+                test,
+                Cost=1,
+                CL=0.95,
+                Inconclusive=0.95,
+                Prevalence=0,
+                Plot=TRUE,
+                Plot.inc.range=TRUE,
+                Plot.Cl=FALSE,
+                Plot.cutoff="None",
+                cex.sub=0.85,
+                Print=TRUE){
+                
+  #require(epitools)
+  #TP sum(test.table[i:nrow(test.table),2])
+  #FP sum(test.table[i:nrow(test.table),1])
+  #TN sum(test.table[1:i-1,1])
+  #FN sum(test.table[1:i-1,2])
+  
+  test.table<-table(test,gold)
+  if (dim(test.table)[2] != 2){
+      stop("It seems that your gold standard has more than 2 categories")
+  }
+  sample.prevalence<-(sum(test.table[,2]))/(sum(test.table))
+  if (Prevalence==0){
+    pop.prevalence<-sample.prevalence
+  }
+  if (Prevalence>0){
+    (pop.prevalence<-Prevalence)
+  }
+  names(sample.prevalence)<-c("Disease prevalence in the sample")
+  names(pop.prevalence)<-c("Informed disease prevalence in the population")
+  sample.size<-sum(test.table)
+  names(sample.size)<-c("Sample size")
+  test.summary<-round(c(summary(test),sd(test)),digits=5)
+  names(test.summary)<-c("Min.","1st Qu.","Median","Mean","3rd Qu.","Max.","SD")
+  cost<-Cost
+  names(cost)<-c("Informed costs(FN)/costs(FP)")
+  conf.limit<-CL
+  inc<-Inconclusive
+  names(inc)<-"Inconclusive tolerance level"
+  test.values<-(as.numeric(rownames(unclass(test.table))))
+  non.parametric<-as.data.frame(test.values)
+  for (i in 1:nrow(non.parametric)) {
+    non.parametric$Sensitivity[i] <- round(sum(test.table[(i:nrow(test.table)),2])/
+      sum(test.table[,2]),digits=4)
+    non.parametric$Se.inf.Cl[i]<-round(as.numeric(binom.wilson(sum(test.table[i:nrow(
+      test.table),2]),sum(test.table[,2]),conf.level=CL)[4]),digits=4)
+    non.parametric$Se.sup.Cl[i]<-round(as.numeric(binom.wilson(sum(test.table[i:nrow(
+      test.table),2]),sum(test.table[,2]),conf.level=CL)[5]),digits=4)
+    non.parametric$Specificity[i] <- round((sum(test.table[(1:i-1),1]))/(sum(
+      test.table[,1])),digits=4)
+    non.parametric$Sp.inf.Cl[i]<-round(as.numeric(binom.wilson(sum(test.table[(
+      1:i-1),1]),sum(test.table[,1]),conf.level=CL)[4]),digits=4)
+    non.parametric$Sp.sup.Cl[i]<-round(as.numeric(binom.wilson(sum(test.table[
+      (1:i-1),1]),sum(test.table[,1]),conf.level=CL)[5]),digits=4)
+    }
+  non.parametric$PLR<-round(non.parametric$Sensitivity/(1-non.parametric$Specificity),digits=2)
+  non.parametric$PLR.inf.cl<-round(exp(log(non.parametric$PLR)-
+    (qnorm(1-((1-CL)/2),mean=0,sd=1))*sqrt((1-non.parametric$Sensitivity)/
+    ((sum(non.parametric[,2]))*non.parametric$Specificity)+
+    (non.parametric$Specificity)/((sum(non.parametric[,1]))*
+    (1-non.parametric$Specificity)))),digits=2)
+  non.parametric$PLR.sup.cl<-round(exp(log(non.parametric$PLR)+(qnorm(1-((1-CL)/
+    2),mean=0,sd=1))*sqrt((1-non.parametric$Sensitivity)/((sum(
+    non.parametric[,2]))*non.parametric$Specificity)+(
+    non.parametric$Specificity)/((sum(non.parametric[,1]))*(1-
+    non.parametric$Specificity)))),digits=2)
+
+  cutoff.table<-as.data.frame(test.values)
+  cutoff.table$Se.equals.Sp<-abs(non.parametric$Specificity-non.parametric$Sensitivity)
+  # Efficiency= Se*prevalence+(1-prevalence)*Se
+  cutoff.table$Efficiency<-(non.parametric$Sensitivity*(pop.prevalence)
+    )+((1-(pop.prevalence))*non.parametric$Specificity)
+  # MissClassificatioCost(MCT)=(1-prevalence)(1-Sp)+r*prevalence(1-Se) - r=cost(FN)/cost(FP)
+  cutoff.table$MCT<-(1-(pop.prevalence))*(1-non.parametric$Specificity)+(Cost*
+    (pop.prevalence))*(1-non.parametric$Sensitivity)
+
+
+  best.cutoff<-cutoff.table$test.values[which.min(cutoff.table$Se.equals.Sp)]
+  test.best.cutoff<-cbind(best.cutoff,non.parametric[
+           which.min(cutoff.table$Se.equals.Sp),2:10])
+  best.cutoff<-cutoff.table$test.values[which.max(cutoff.table$Efficiency)]
+  test.best.cutoff<-rbind(test.best.cutoff,cbind(best.cutoff,non.parametric[
+           which.max(cutoff.table$Efficiency),2:10]))
+  best.cutoff<-cutoff.table$test.values[which.min(cutoff.table$MCT)]
+  test.best.cutoff<-rbind(test.best.cutoff,cbind(best.cutoff,non.parametric[
+           which.min(cutoff.table$MCT),2:10]))
+  rownames(test.best.cutoff)<- c("Se=Sp","Max. Efficiency","Min. MCT")
+  best.cutoff<-test.best.cutoff
+  rm(test.best.cutoff)
+  non.parametric.inconclusive<-non.parametric[which.min(abs(
+      Inconclusive-non.parametric$Sensitivity)),1:10]
+  non.parametric.inconclusive<-rbind(non.parametric.inconclusive,non.parametric[
+      which.min(abs(Inconclusive-non.parametric$Specificity)),1:10])
+  rownames(non.parametric.inconclusive)<-c("Lower inconclusive","Upper inconclusive")
+  if(Plot==TRUE){
+    plot(non.parametric$test.values,non.parametric$Sensitivity,
+         ylim=c(0,1),type="l",col=2, xlab="test scale",ylab="Sensitivity & Specificity",
+         lty=1)
+    lines(non.parametric$test.values,non.parametric$Specificity,col=4,lty=2)
+    leg.txt<-c("Se", "Sp")      
+    fill.col<-c(2,4)
+    line.type<-c(1,2)
+    if(Plot.inc.range==TRUE){
+      abline(h=Inconclusive,col="lightgray",lty=4)
+      abline(v=(non.parametric.inconclusive[1,1]),col="lightgray",lty=4)
+      abline(v=(non.parametric.inconclusive[2,1]),col="lightgray",lty=4)
+      leg.txt<-c(leg.txt,c("Inc limits"))      
+      fill.col<-c(fill.col,c("lightgray"))
+      line.type<-c(line.type,4)
+      subtitle<-paste("Non-parametric inconclusive limits at",formatC(inc),"level:",formatC(non.parametric.inconclusive[1,1]),"-",formatC(non.parametric.inconclusive[2,1]),".")
+      }
+    if(Plot.Cl==TRUE){
+    lines(non.parametric$test.values,non.parametric$Se.inf.Cl,lty=5,col=2)
+    lines(non.parametric$test.values,non.parametric$Se.sup.Cl,lty=5,col=2)
+    lines(non.parametric$test.values,non.parametric$Sp.inf.Cl,lty=3,col=4)
+    lines(non.parametric$test.values,non.parametric$Sp.sup.Cl,lty=3,col=4)
+    leg.txt<-c(leg.txt,c("Se conf band","Sp conf band"))      
+    fill.col<-c(fill.col,c(2,4))
+    line.type<-c(line.type,5,3)
+    }
+    if(Plot.cutoff=="Se=Sp"){
+          abline(v=(best.cutoff[1,1]),col="lightgray",lty=6)
+          leg.txt<-c(leg.txt,c("Best cut-off"))      
+          fill.col<-c(fill.col,c("lightgray"))
+          line.type<-c(line.type,6)
+          subtitle<-paste(subtitle,paste("Cut-off estimated by Se=Sp:",formatC(best.cutoff[1,1])))
+          }
+    if(Plot.cutoff=="Max.Efficiency"){
+          abline(v=(best.cutoff[2,1]),col="lightgray",lty=6)
+          leg.txt<-c(leg.txt,c("Best cut-off"))      
+          fill.col<-c(fill.col,c("lightgray"))
+          line.type<-c(line.type,6)
+          subtitle<-paste(subtitle,paste("Cut-off estimated by Max. Efficiency:",formatC(best.cutoff[2,1]),"."))
+          #"Pop. prevalence:",formatC(pop.prevalence)))) Does not fit in the graph
+          }
+    if(Plot.cutoff=="Min.MCT"){
+          abline(v=(best.cutoff[3,1]),col="lightgray",lty=6)
+          leg.txt<-c(leg.txt,c("Best cut-off"))      
+          fill.col<-c(fill.col,c("lightgray"))
+          line.type<-c(line.type,6)
+          subtitle<-paste(subtitle,paste("Cut-off estimated by Minimizing MCT:",formatC(best.cutoff[3,1],".")))
+          #,"Pop. prevalence:",formatC(pop.prevalence),"Cost FN/FP:",formatC(cost))) Does not fit in the graph
+          }
+    legend("right",legend=leg.txt,col=fill.col, lty=line.type, bty="n")
+    title(sub=subtitle,cex.sub=cex.sub)         
+  }          
+  rm(test.values)
+  if(non.parametric.inconclusive[1,1]>=non.parametric.inconclusive[2,1])
+     {
+     warning("Lower inconclusive limit is higher than upper inconclusive limit.")
+     }
+  reteval<-list(sample.size=sample.size,sample.prevalence=sample.prevalence,pop.prevalence=pop.prevalence,cost=cost,test.summary=test.summary,inc=inc,conf.limit=conf.limit,non.parametric=non.parametric,non.parametric.inconclusive=non.parametric.inconclusive,best.cutoff=best.cutoff,cutoff.table=cutoff.table)
+  class(reteval)<-"TGROC"
+  if(Print==TRUE)  {print(reteval)}
+  invisible(reteval)
+}
\ No newline at end of file

Modified: pkg/DiagnosisMed/R/print.ROC.r
===================================================================
--- pkg/DiagnosisMed/R/print.ROC.r	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/R/print.ROC.r	2009-04-19 03:55:15 UTC (rev 11)
@@ -1,4 +1,4 @@
-print.ROC<-function(x,...,Full=FALSE){
+print.ROC<-function(x,Full=FALSE,...){
   if (Full==TRUE){ page(x$test.diag.table,method="print")}
   cat("          Sample size:",paste(x$sample.size),"\n")
   cat("    Sample prevalence:",paste(round(x$sample.prevalence,digits = 4)),"\n")

Modified: pkg/DiagnosisMed/R/print.diag.r
===================================================================
--- pkg/DiagnosisMed/R/print.diag.r	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/R/print.diag.r	2009-04-19 03:55:15 UTC (rev 11)
@@ -6,19 +6,19 @@
   cat("The test has the following parameters [",paste(x$Conf.limit*100),"% confidence interval]\n")
   cat("---------------------------------------------------------------\n")
   cat("Sample size:                ",x$n,"\n")
-  cat("Prevalence considered:      ",round(x$p*100,digits=2),"%\n")
-  cat("Sensitivity:                ",round(x$Se*100,digits=2),"% [",round(x$Se.cl[1]*100,digits=2)," - ",round(x$Se.cl[2]*100,digits=2),"]\n")
-  cat("Specificity:                ",round(x$Sp*100,digits=2),"% [",round(x$Sp.cl[1]*100,digits=2)," - ",round(x$Sp.cl[2]*100,digits=2),"]\n")
-  cat("Positive predictive value:  ",round(x$PPV*100,digits=2),"% [",round(x$PPV.cl[1]*100,digits=2)," - ",round(x$PPV.cl[2]*100,digits=2),"]\n")
-  cat("Negative predictive value:  ",round(x$NPV*100,digits=2),"% [",round(x$NPV.cl[1]*100,digits=2)," - ",round(x$NPV.cl[2]*100,digits=2),"]\n")
-  cat("Positive likelihood ratio:  ",round(x$PLR,digits=2),"  [",round(x$PLR.inf.cl,digits=2)," - ",round(x$PLR.sup.cl,digits=2),"]\n")
-  cat("Negative likelihood ratio:  ",round(x$NLR,digits=2),"   [",round(x$NLR.inf.cl,digits=2)," - ",round(x$NLR.sup.cl,digits=2),"]\n")
-  cat("Diagnostic odds ratio:      ",round(x$DOR,digits=2)," [",round(x$DOR.inf.cl,digits=2)," - ",round(x$DOR.sup.cl,digits=2),"]\n")
-  cat("Error trade off (FN : FP)   ",round(x$ET,digits=2)," : 1 \n")
-  cat("Error rate:                 ",round(x$ER*100,digits=2),"% [",round(x$ER.cl[1]*100,digits=2)," - ",round(x$ER.cl[2]*100,digits=2),"]\n")
-  cat("Accuracy:                   ",round(x$accu*100,digits=2),"% [",round(x$accu.cl[1]*100,digits=2)," - ",round(x$accu.cl[2]*100,digits=2),"]\n")
-  cat("Youden index:               ",round(x$Youden,digits=4)," [",round(x$Youden.inf.cl,digits=4)," - ",round(x$Youden.sup.cl,digits=4),"]\n")
-  cat("Area under ROC curve:       ",round(x$AUC,digits=4),"\n")
+  cat("Prevalence considered:      ",paste(round(x$p*100,digits=2)),"%\n")
+  cat("Sensitivity:                ",paste(round(x$Se*100,digits=2)),"% [",paste(round(x$Se.cl[1]*100,digits=2))," - ",paste(round(x$Se.cl[2]*100,digits=2)),"]\n")
+  cat("Specificity:                ",paste(round(x$Sp*100,digits=2)),"% [",paste(round(x$Sp.cl[1]*100,digits=2))," - ",paste(round(x$Sp.cl[2]*100,digits=2)),"]\n")
+  cat("Positive predictive value:  ",paste(round(x$PPV*100,digits=2)),"% [",paste(round(x$PPV.cl[1]*100,digits=2))," - ",paste(round(x$PPV.cl[2]*100,digits=2)),"]\n")
+  cat("Negative predictive value:  ",paste(round(x$NPV*100,digits=2)),"% [",paste(round(x$NPV.cl[1]*100,digits=2))," - ",paste(round(x$NPV.cl[2]*100,digits=2)),"]\n")
+  cat("Positive likelihood ratio:  ",paste(round(x$PLR,digits=2)),"  [",paste(round(x$PLR.inf.cl,digits=2))," - ",paste(round(x$PLR.sup.cl,digits=2)),"]\n")
+  cat("Negative likelihood ratio:  ",paste(round(x$NLR,digits=2)),"   [",paste(round(x$NLR.inf.cl,digits=2))," - ",paste(round(x$NLR.sup.cl,digits=2)),"]\n")
+  cat("Diagnostic odds ratio:      ",paste(round(x$DOR,digits=2))," [",paste(round(x$DOR.inf.cl,digits=2))," - ",paste(round(x$DOR.sup.cl,digits=2)),"]\n")
+  cat("Error trade off (FN : FP)   ",paste(round(x$ET,digits=2))," : 1 \n")
+  cat("Error rate:                 ",paste(round(x$ER*100,digits=2)),"% [",paste(round(x$ER.cl[1]*100,digits=2))," - ",paste(round(x$ER.cl[2]*100,digits=2)),"]\n")
+  cat("Accuracy:                   ",paste(round(x$accu*100,digits=2)),"% [",paste(round(x$accu.cl[1]*100,digits=2))," - ",paste(round(x$accu.cl[2]*100,digits=2)),"]\n")
+  cat("Youden index:               ",paste(round(x$Youden,digits=4))," [",paste(round(x$Youden.inf.cl,digits=4))," - ",paste(round(x$Youden.sup.cl,digits=4)),"]\n")
+  cat("Area under ROC curve:       ",paste(round(x$AUC,digits=4)),"\n")
   cat("---------------------------------------------------------------\n")
   #options(digits=7)
 }

Modified: pkg/DiagnosisMed/R/zzz.r
===================================================================
--- pkg/DiagnosisMed/R/zzz.r	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/R/zzz.r	2009-04-19 03:55:15 UTC (rev 11)
@@ -1,7 +1,7 @@
 # first and last
 .First.lib <- function(lib, pkg)
 {
-require("epitools","epicalc",quietly=TRUE,warn.conflicts=FALSE)
+#require("epitools","epicalc","TeachingDemos","tcltk",quietly=TRUE,warn.conflicts=FALSE)
 # if (.Platform$OS.type=="windows")
 see <- packageDescription(pkg,fields="Version")
 cat("'DiagnosisMed' library",see," loaded\n",sep=" ")

Modified: pkg/DiagnosisMed/chm/00Index.html
===================================================================
--- pkg/DiagnosisMed/chm/00Index.html	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/chm/00Index.html	2009-04-19 03:55:15 UTC (rev 11)
@@ -10,7 +10,7 @@
 <param name="keyword" value=".. contents">
 </object>
 
-<h2>Help pages for package &lsquo;DiagnosisMed&rsquo; version 0.1.2.1</h2>
+<h2>Help pages for package &lsquo;DiagnosisMed&rsquo; version 0.2</h2>
 
 
 <table width="100%">
@@ -20,14 +20,22 @@
 <td>Diagnostic test accuracy evaluation</td></tr>
 <tr><td width="25%"><a href="interact.ROC.html">interact.ROC</a></td>
 <td>Interactively draw a ROC curve with your data</td></tr>
+<tr><td width="25%"><a href="LRgrgaph.html">LRgraph</a></td>
+<td>Comparing diagnositic tests: a simple graphic using likelihood ratios.</td></tr>
 <tr><td width="25%"><a href="plot.diag.html">plot.diag</a></td>
 <td>Nomogram from 2x2 table diagnostic test</td></tr>
 <tr><td width="25%"><a href="diagnosis.html">print.diag</a></td>
 <td>Diagnostic test accuracy evaluation</td></tr>
+<tr><td width="25%"><a href="ROC.html">print.ROC</a></td>
+<td>Draw a ROC curve, estimate good cut-offs and compute validity measures for each cut-off</td></tr>
+<tr><td width="25%"><a href="TGROC.html">print.TGROC</a></td>
+<td>TG-ROC - Two Graphic Receiver Operating Characteristic</td></tr>
 <tr><td width="25%"><a href="ROC.html">ROC</a></td>
-<td>Draw a ROC curve, estimate good cut-offs and compute validity measures        for each cut-off</td></tr>
+<td>Draw a ROC curve, estimate good cut-offs and compute validity measures for each cut-off</td></tr>
 <tr><td width="25%"><a href="rocdata.html">rocdata</a></td>
 <td>Example data set for continuos tests results</td></tr>
+<tr><td width="25%"><a href="TGROC.html">TGROC</a></td>
+<td>TG-ROC - Two Graphic Receiver Operating Characteristic</td></tr>
 <tr><td width="25%"><a href="tutorial.html">tutorial</a></td>
 <td>Example data set for continuos tests results</td></tr>
 </table>

Modified: pkg/DiagnosisMed/chm/DiagnosisMed.hhp
===================================================================
--- pkg/DiagnosisMed/chm/DiagnosisMed.hhp	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/chm/DiagnosisMed.hhp	2009-04-19 03:55:15 UTC (rev 11)
@@ -12,7 +12,9 @@
 
 [FILES]
 00Index.html
+LRgrgaph.html
 ROC.html
+TGROC.html
 diagnosis.html
 interact.ROC.html
 plot.diag.html

Modified: pkg/DiagnosisMed/chm/DiagnosisMed.toc
===================================================================
--- pkg/DiagnosisMed/chm/DiagnosisMed.toc	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/chm/DiagnosisMed.toc	2009-04-19 03:55:15 UTC (rev 11)
@@ -22,6 +22,10 @@
 <param name="Local" value="interact.ROC.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="LRgraph">
+<param name="Local" value="LRgrgaph.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="plot.diag">
 <param name="Local" value="plot.diag.html">
 </OBJECT>
@@ -30,6 +34,14 @@
 <param name="Local" value="diagnosis.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="print.ROC">
+<param name="Local" value="ROC.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
+<param name="Name" value="print.TGROC">
+<param name="Local" value="TGROC.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="ROC">
 <param name="Local" value="ROC.html">
 </OBJECT>
@@ -38,6 +50,10 @@
 <param name="Local" value="rocdata.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="TGROC">
+<param name="Local" value="TGROC.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="tutorial">
 <param name="Local" value="tutorial.html">
 </OBJECT>
@@ -47,11 +63,15 @@
 </OBJECT>
 <UL>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="Comparing diagnositic tests: a simple graphic using likelihood ratios.">
+<param name="Local" value="LRgrgaph.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="Diagnostic test accuracy evaluation">
 <param name="Local" value="diagnosis.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
-<param name="Name" value="Draw a ROC curve, estimate good cut-offs and compute validity measures        for each cut-off">
+<param name="Name" value="Draw a ROC curve, estimate good cut-offs and compute validity measures for each cut-off">
 <param name="Local" value="ROC.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
@@ -66,6 +86,10 @@
 <param name="Name" value="Nomogram from 2x2 table diagnostic test">
 <param name="Local" value="plot.diag.html">
 </OBJECT>
+<LI> <OBJECT type="text/sitemap">
+<param name="Name" value="TG-ROC - Two Graphic Receiver Operating Characteristic">
+<param name="Local" value="TGROC.html">
+</OBJECT>
 </UL>
 </UL>
 </BODY></HTML>

Modified: pkg/DiagnosisMed/chm/ROC.html
===================================================================
--- pkg/DiagnosisMed/chm/ROC.html	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/chm/ROC.html	2009-04-19 03:55:15 UTC (rev 11)
@@ -1,5 +1,4 @@
-<html><head><title>Draw a ROC curve, estimate good cut-offs and compute validity measures
-for each cut-off</title>
+<html><head><title>Draw a ROC curve, estimate good cut-offs and compute validity measures for each cut-off</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <link rel="stylesheet" type="text/css" href="Rchm.css">
 </head>
@@ -7,22 +6,18 @@
 
 <table width="100%"><tr><td>ROC(DiagnosisMed)</td><td align="right">R Documentation</td></tr></table><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
 <param name="keyword" value="R:   ROC">
-<param name="keyword" value=" Draw a ROC curve estimate good cut-offs and compute validity measures
-for each cut-off">
+<param name="keyword" value="R:   print.ROC">
+<param name="keyword" value=" Draw a ROC curve estimate good cut-offs and compute validity measures for each cut-off">
 </object>
 
 
-<h2>Draw a ROC curve estimate good cut-offs and compute validity measures
-for each cut-off</h2>
+<h2>Draw a ROC curve estimate good cut-offs and compute validity measures for each cut-off</h2>
 
 
 <h3>Description</h3>
 
 <p>
-Draw a non-parametric (empirical) ROC curve and compute test sensitivity,
-specificity, predictive values and likelihood ratios (and respective confidence
-limits) for each decision threshold. Estimate good decision threshold by a
-variety of methods.
+Draw a non-parametric (empirical) ROC curve and compute test sensitivity, specificity, predictive values and likelihood ratios (and respective confidence limits) for each decision threshold. Estimate good decision threshold by a variety of methods.
 </p>
 
 
@@ -46,46 +41,25 @@
 <table summary="R argblock">
 <tr valign="top"><td><code>gold</code></td>
 <td>
-The reference standard. A column in a data frame indicating the classification
-by the reference test. The reference standard must have two levels: must be
-coded either as 0 - without target disease - or 1 - with the target disease;
-or could be coded <a onclick="findlink('base', 'as.factor.html')" style="text-decoration: underline; color: blue; cursor: hand">as.factor</a> with the words "negative" - without target disease - and
-"positive"  - with the target disease.</td></tr>
+The reference standard. A column in a data frame indicating the classification by the reference test. The reference standard must have two levels: must be coded either as 0 - without target condition - or 1 - with the target condition; or could be coded <a onclick="findlink('base', 'as.factor.html')" style="text-decoration: underline; color: blue; cursor: hand">as.factor</a> with the words "negative" - without target condition - and "positive"  - with the target condition.</td></tr>
 <tr valign="top"><td><code>test</code></td>
 <td>
-The index test or test under evaluation. A column in a dataframe or vector
-indicating the test results in a continuous scale. May also work with discrete
-ordinal scale.</td></tr>
+The index test or test under evaluation. A column in a dataframe or vector indicating the test results in a continuous scale. May also work with discrete ordinal scale.</td></tr>
 <tr valign="top"><td><code>CL</code></td>
 <td>
-Confidence limit. The limits of the confidence interval. Must be coded
-as number in a range from 0 to 1. Default value is 0.95</td></tr>
+Confidence limit. The limits of the confidence interval. Must be coded as number in a range from 0 to 1. Default value is 0.95</td></tr>
 <tr valign="top"><td><code>Cost</code></td>
 <td>
-Cost = cost(FN)/cost(FP). MCT will be used to estimate a
-good cut-off. It is a value in a range from 0 to infinite.
-Could be financial cost or a health outcome with the perception that FN are
-more undesirable than FP (or the other way around). This item will run
-into MCT (misclassification cost term) - (1-prevalence)*(1-Sp)+Cost*prevalence(1-Se).
-Cost=1 means FN and FP have even cost. Cost = 0.9 means FP are 10 percent
-more costly. Cost = 0.769 means that FP are 30 percent more costly. Cost =
-0.555 means that FP are 80 percent more costly. Cost = 0.3 means that FP
-are 3 times more costly. Cost = 0.2 means that FP are 5 times more costly.
-Also, it can be inserted as any ratio such as 1/2.5 or 1/4.
-</td></tr>
+Cost = cost(FN)/cost(FP). MCT will be used to estimate a good cut-off. It is a value in a range from 0 to infinite. Could be financial cost or a health outcome with the perception that FN are more undesirable than FP (or the other way around). This item will run into MCT (misclassification cost term) - (1-prevalence)*(1-Sp)+Cost*prevalence(1-Se). Cost=1 means FN and FP have even cost. Cost = 0.9 means FP are 10 percent more costly. Cost = 0.769 means that FP are 30 percent more costly. Cost = 0.555 means that FP are 80 percent more costly. Cost = 0.3 means that FP are 3 times more costly. Cost = 0.2 means that FP are 5 times more costly. Also, it can be inserted as any ratio such as 1/2.5 or 1/4.</td></tr>
 <tr valign="top"><td><code>Prevalence</code></td>
 <td>
-Prevalence of the disease in the population who the test will
-be performed. If left 0 (the default value), this will be replaced by the
-disease prevalence in the sample. This values will be used in the MCT and
-Efficiency formulas to estime good cut-offs.</td></tr>
+Prevalence of the disease in the population who the test will be performed. It must be a value from 0 to 1. If left 0 (the default value), this will be replaced by the disease prevalence in the sample. This values will be used in the MCT and Efficiency formulas to estimate good  cut-offs.</td></tr>
 <tr valign="top"><td><code>Plot</code></td>
 <td>
 If FALSE, the ROC curve plot will not be displayed. Default is TRUE.</td></tr>
 <tr valign="top"><td><code>Plot.point</code></td>
 <td>
-The method of best cut-off estimation which will be displayed
-at ROC curve as a dot. Default is "Min.ROC.Dist". Possible options are:
+The method of best cut-off estimation which will be displayed at ROC curve as a dot. Default is "Min.ROC.Dist". Possible options are: 
 <br>
 "Max.Accuracy" - the cut-off which maximize the accuracy;
 <br>
@@ -109,33 +83,16 @@
 </td></tr>
 <tr valign="top"><td><code>Print.full</code></td>
 <td>
-If TRUE, a table with sensitivity, specificity, predictive values
-and likelihood ratios (and respective confidence limits) for each decision
-threshold will be displayed.</td></tr>
+If TRUE, a table with sensitivity, specificity, predictive values and likelihood ratios (and respective confidence limits) for each decision threshold will be displayed.</td></tr>
 <tr valign="top"><td><code>Print</code></td>
 <td>
-If FALSE, no results (detailed below in vlaues section) will be displayed on the
-output window. Default is TRUE</td></tr>
+If FALSE, no results (detailed below in vlaues section) will be displayed on the output window. Default is TRUE</td></tr>
 </table>
 
 <h3>Details</h3>
 
 <p>
-Tests results matching the cut-off values will be considered a positive test.
-ROC assumes that subjects with higher values of the test are with the target
-condition and those with lower values are without the target condition. Tests
-that behave like glucose (middle values are supposed to be normal and
-extreme values are supposed to be abnormal) and immunefluorescence (lower
-values - higher dilutions - are suppose to be abnormal) will not be correctly
-analyzed. In the latter, multiplying the test results by -1 or other
-transformation before analysis could make it work. The result table with the
-Print.full option, may have more columns than can be shown in the screen. R
-automatically  shows these columns below, therefore one has to be careful when
-relating the corresponding lines. The AUC (area under the ROC curve) is estimated 
-by the trapezoidal method (also known as Mann-Whitney statistic), its confidence
-interval is estimated by DeLong method. The validity measures such as 
-Sensitivity, Specificity and Likelihood ratios are estimated as 
-in <code><a href="diagnosis.html">diagnosis</a></code> function.
+Tests results matching the cut-off values will be considered a positive test. ROC assumes that subjects with higher values of the test are with the target condition and those with lower values are without the target condition. Tests that behave like glucose (middle values are supposed to be normal and extreme values are supposed to be abnormal) and immunefluorescence (lower values - higher dilutions - are suppose to be abnormal) will not be correctly analyzed. In the latter, multiplying the test results by -1 or other transformation before analysis could make it work. The result table with the Print.full option, may have more columns than can be shown in the screen. R automatically  shows these columns below, therefore one has to be careful when relating the corresponding lines. The AUC (area under the ROC curve) is estimated by the trapezoidal method (also known as Mann-Whitney statistic), its confidence interval is estimated by DeLong method. The AUC confidence limits should be used only to compare the AUC with the null value for AUC which is 0.5 and not to compare the AUC from different tests. The validity measures such as Sensitivity, Specificity and Likelihood ratios and its confidence limits are estimated as in <code><a href="diagnosis.html">diagnosis</a></code> function.
 </p>
 <p>
 Diagnostic odds ratio: <i>DOR = (TP*TN)/(FN*FP); the same as: DOR = PLR/NLR</i>
@@ -162,8 +119,7 @@
 <table summary="R argblock">
 <tr valign="top"><td><code>pop.prevalence</code></td>
 <td>
-The disease prevalence informed by the user. If not
-informed, it will be the same as the sample prevalence.</td></tr>
+The disease prevalence informed by the user. If not informed, it will be the same as the sample prevalence.</td></tr>
 <tr valign="top"><td><code>sample.prevalence</code></td>
 <td>
 The disease prevalence in the sample</td></tr>
@@ -172,18 +128,14 @@
 The number of subjects analyzed</td></tr>
 <tr valign="top"><td><code>test.summary</code></td>
 <td>
-A table showing the quintiles, mean and standard deviation
-of overall test results, test results from those with the target condition
-and without the target condition</td></tr>
+A table showing the quintiles, mean and standard deviation of overall test results, test results from those with the target condition and without the target condition</td></tr>
 <tr valign="top"><td><code>AUC.summary</code></td>
 <td>
 A table showing the AUC estimated by DeLong method (trapezoidal)
 and its confidence limits.</td></tr>
 <tr valign="top"><td><code>test.best.cutoff</code></td>
 <td>
-A table showing the best cut-offs estimated by methods
-described above, its corresponding sensitivity, specificity and positive
-likelihood ratio (and their confidence limits)</td></tr>
+A table showing the best cut-offs estimated by methods described above, its corresponding sensitivity, specificity and positive likelihood ratio (and their confidence limits)</td></tr>
 </table>
 
 <h3>Note</h3>
@@ -196,7 +148,7 @@
 <h3>Author(s)</h3>
 
 <p>
-Pedro Brasil - <a href="mailto:diagnosismed-list at lists.r-forge.r-project.org">diagnosismed-list at lists.r-forge.r-project.org</a>
+Pedro Brasil; Beranrdo Rangel Tura - <a href="mailto:diagnosismed-list at lists.r-forge.r-project.org">diagnosismed-list at lists.r-forge.r-project.org</a>
 </p>
 
 
@@ -225,7 +177,7 @@
 <h3>See Also</h3>
 
 <p>
-<a onclick="findlink('epitools', 'binom.conf.int.html')" style="text-decoration: underline; color: blue; cursor: hand">binom.conf.int</a>,<code><a href="diagnosis.html">diagnosis</a></code>,<code><a href="interact.ROC.html">interact.ROC</a></code>,<a onclick="findlink('ROCR', 'performance.html')" style="text-decoration: underline; color: blue; cursor: hand">performance</a>
+<a onclick="findlink('epitools', 'binom.conf.int.html')" style="text-decoration: underline; color: blue; cursor: hand">binom.conf.int</a>,<code><a href="diagnosis.html">diagnosis</a></code>,<code><a href="interact.ROC.html">interact.ROC</a></code>,<code><a href="TGROC.html">TGROC</a></code>,<a onclick="findlink('ROCR', 'performance.html')" style="text-decoration: underline; color: blue; cursor: hand">performance</a>,link[nonbinROC]{contROC}
 </p>
 
 
@@ -258,6 +210,6 @@
 </script>
 
 
-<hr><div align="center">[Package <em>DiagnosisMed</em> version 0.1.2.1 <a href="00Index.html">Index]</a></div>
+<hr><div align="center">[Package <em>DiagnosisMed</em> version 0.2 <a href="00Index.html">Index]</a></div>
 
 </body></html>

Modified: pkg/DiagnosisMed/chm/diagnosis.html
===================================================================
--- pkg/DiagnosisMed/chm/diagnosis.html	2009-04-13 20:29:56 UTC (rev 10)
+++ pkg/DiagnosisMed/chm/diagnosis.html	2009-04-19 03:55:15 UTC (rev 11)
@@ -18,9 +18,7 @@
 <h3>Description</h3>
 
 <p>
-diagnosis estimate sensitivity, specificity, predictive values, likelihood
-ratios, area under ROC curve and other validity measures for binary diagnostic
-test evaluation.
+diagnosis estimate sensitivity, specificity, predictive values, likelihood ratios, area under ROC curve and other validity measures for binary diagnostic test evaluation.
 </p>
 
 
@@ -55,37 +53,19 @@
 A number representing True Negatives from a 2x2 table</td></tr>
 <tr valign="top"><td><code>print</code></td>
 <td>
-If TRUE, diagnosis will print in the output window the
-statistics resulted from the 2x2 table. Default is TRUE.</td></tr>
+If TRUE, diagnosis will print in the output window the statistics resulted from the 2x2 table. Default is TRUE.</td></tr>
 <tr valign="top"><td><code>plot</code></td>
 <td>
-If TRUE, diagnosis will plot a ROC curve of the test under
-evaluation. This plot may later be edited, as any other plot, with title,
-legends etc. Default is FALSE.</td></tr>
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/diagnosismed -r 11


More information about the Diagnosismed-commits mailing list