Showing 1 of 3 files from the diff.

@@ -20,7 +20,10 @@
Loading
20 20
power.roc.test <- function(...)
21 21
  UseMethod("power.roc.test")
22 22
23 -
power.roc.test.roc <- function(roc1, roc2, sig.level = 0.05, power = NULL, alternative = c("two.sided", "one.sided"), reuse.auc=TRUE, method=c("delong", "bootstrap", "obuchowski"), ...) {
23 +
power.roc.test.roc <- function(roc1, roc2, sig.level = 0.05, power = NULL, kappa = NULL,
24 +
							   alternative = c("two.sided", "one.sided"), 
25 +
							   reuse.auc=TRUE, method=c("delong", "bootstrap", "obuchowski"),
26 +
							   ...) {
24 27
  # Basic sanity checks
25 28
  if (!is.null(power) && (power < 0 || power > 1))
26 29
    stop("'power' must range from 0 to 1")
@@ -70,7 +73,9 @@
Loading
70 73
 
71 74
      ncontrols <- length(roc1$controls)
72 75
      ncases <- length(roc1$cases)
73 -
      kappa <- ncontrols / ncases
76 +
      if (is.null(kappa)) {
77 +
        kappa <- ncontrols / ncases
78 +
      }
74 79
75 80
      # Power test
76 81
      if (is.null(power)) {
@@ -105,16 +110,17 @@
Loading
105 110
    }
106 111
  }
107 112
  else {
108 -
    if (is.null(sig.level) || is.null(power)) {
109 -
      ncontrols <- length(roc1$controls)
110 -
      ncases <- length(roc1$cases)
111 -
    }
112 -
    else {
113 +
  	ncontrols <- length(roc1$controls)
114 +
  	ncases <- length(roc1$cases)
115 +
    if (! is.null(sig.level) && ! is.null(power)) {
116 +
      if (is.null(kappa)) {
117 +
        kappa <- ncontrols / ncases
118 +
      }
113 119
      ncontrols <- ncases <- NULL
114 120
    }
115 121
    auc <- auc(roc1)
116 122
    # TODO: implement this with var() and cov() for the given ROC curve
117 -
    return(power.roc.test.numeric(ncontrols = ncontrols, ncases = ncases, auc = auc, sig.level = sig.level, power = power, alternative = alternative, ...))
123 +
    return(power.roc.test.numeric(ncontrols = ncontrols, ncases = ncases, auc = auc, sig.level = sig.level, power = power, alternative = alternative, kappa = kappa, ...))
118 124
  }
119 125
}
120 126
Files Coverage
R 86.06%
src 100.00%
Project Totals (33 files) 86.47%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading