Last data update: 2014.03.03

R: Calculate number of cases for specified number of readers J...
SampleSizeGivenJR Documentation

Calculate number of cases for specified number of readers J to achieve the desired power for ROC studies.

Description

Calculate required number of cases to achieve the desired power for specified number of readers J and DBM or OR variability parameters.

Usage

SampleSizeGivenJ(J, varYTR, varYTC, varYEps, cov1, cov2, cov3, varEps, msTR,
  KStar, alpha = 0.05, effectSize = 0.05, desiredPower = 0.8,
  randomOption = "ALL")

Arguments

J

The number of readers.

varYTR

The DBM pseudovalue treatment-by-reader variance component.

varYTC

The DBM pseudovalue treatment-by-case variance component.

varYEps

The DBM pseudovalue error variance.

cov1

The covariance of the FOM resampling estimates for same reader and different modalities.

cov2

The covariance of the FOM resampling estimates for different readers and same modalities.

cov3

The covariance of the FOM resampling estimates for different readers and different modalities.

varEps

The variance of the FOM resampling estimates for same reader and same modalities.

msTR

Treatment-by-reader mean square of the FOM.

KStar

The number of cases in the pilot study, only required when using OR variability parameters

alpha

The significance level of the study, default value is 0.05.

effectSize

The effect size to be used in the study, default value is 0.05.

desiredPower

The desired statistical power, default value is 0.8.

randomOption

It can be "ALL", "READERS" or "CASES", which indicate predictions for (1) random readers and random cases, (2) random readers only and (3) random cases only.

Details

To calculate the sample size, either the group of DBM variance components (varYTR, varYTC, and varYEps) or OR covariance matrix elements and mean squares and number of cases in pilot study should be specified. If both of them are given, DBM variance components are used and OR values are ignored. Specifically, either numeric values of varYTR, varYTC, varYEps can be supplied, or the function call must explicitly state cov1 = value1, cov2 = value2, cov3 = value3, varEps = value4, msTR = value5, KStar = value6, as is standard usage in R.

Value

A list of two elements:

K

The minimum number of cases to just achieve the desired statistical power.

power

The predicted statistical power.

References

Hillis, S. L., Obuchowski, N. A., & Berbaum, K. S. (2011). Power Estimation for Multireader ROC Methods: An Updated and Unified Approach. Acad Radiol, 18, 129-142.

Hillis, S. L., Obuchowski, N. A, Schartz, K. M., & Berbaum, K. S. (2005). A comparison of the Dorfman-Berbaum-Metz and Obuchowski-Rockette methods for receiver operating characteristic (ROC) data. Statistics in Medicine, 24(10), 1579-607.

Examples

## Following is an example of sample size calculation with DBM variance components.
retDbm <- DBMHAnalysis(data = rocData, fom = "Wilcoxon")
effectSize <- retDbm$ciDiffTrtRRRC$Estimate
varCompDBM <- retDbm$varComp
varYTR <- varCompDBM$varComp[3]
varYTC <- varCompDBM$varComp[4]
varYEps <- varCompDBM$varComp[6]
SampleSizeGivenJ(J = 6, varYTR = varYTR, varYTC = varYTC, varYEps = varYEps,
                 effectSize =effectSize)

## Following is an example of sample size calculation with OR variance components.
retOR <- ORHAnalysis(data = rocData, fom = "Wilcoxon", covEstMethod = "Jackknife")
effectSize <- retOR$ciDiffTrtRRRC$Estimate
varCompOR <- retOR$varComp
cov1 <- varCompOR$varCov[3]
cov2 <- varCompOR$varCov[4]
cov3 <- varCompOR$varCov[5]
varEps <- varCompOR$varCov[6]
msTR <- retOR$msTR
KStar <- 114
SampleSizeGivenJ(J = 6, cov1 = cov1, cov2 = cov2, cov3 = cov3, varEps= varEps,
                 msTR = msTR, KStar = KStar, effectSize =effectSize)

## Not run: 
## Following is an example of sample size calculation with DBM variance components,
## and scanning the number of readers
retDbm <- DBMHAnalysis(data = rocData, fom = "Wilcoxon")
effectSize <- retDbm$ciDiffTrtRRRC$Estimate
varYTR <- retDbm$varComp$varComp[3]
varYTC <- retDbm$varComp$varComp[4]
varYEps <- retDbm$varComp$varComp[6]
effectSize <- retDbm$ciDiffTrtRRRC$Estimate
for (J in 6:10) {
 ret <- SampleSizeGivenJ(J, varYTR, varYTC, varYEps, effectSize =effectSize)
 message("# of readers = ", J, " estimated # of cases = ", ret$K, ", predicted power = ",
    signif(ret$power,3), "\n")
}

## Following is an example of sample size calculation with OR variance components,
## using bootstrap to estimate variance components
retOR <- ORHAnalysis(data = rocData, fom = "Wilcoxon", covEstMethod = "Bootstrap")
effectSize <- retOR$ciDiffTrtRRRC$Estimate
varCompOR <- retOR$varComp
cov1 <- varCompOR$varCov[3]
cov2 <- varCompOR$varCov[4]
cov3 <- varCompOR$varCov[5]
varEps <- varCompOR$varCov[6]
msTR <- retOR$msTR
KStar <- length(rocData$NL[1,1,,1])
SampleSizeGivenJ(J = 6, cov1 = cov1, cov2 = cov2, cov3 = cov3, varEps= varEps,
                 msTR = msTR, KStar = KStar, effectSize =effectSize)

## End(Not run)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RJafroc)
Loading required package: tools
Loading required package: xlsx
Loading required package: rJava
Loading required package: xlsxjars
Loading required package: ggplot2
Loading required package: stringr
Loading required package: shiny
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RJafroc/SampleSizeGivenJ.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SampleSizeGivenJ
> ### Title: Calculate number of cases for specified number of readers J to
> ###   achieve the desired power for ROC studies.
> ### Aliases: SampleSizeGivenJ
> 
> ### ** Examples
> 
> ## Following is an example of sample size calculation with DBM variance components.
> retDbm <- DBMHAnalysis(data = rocData, fom = "Wilcoxon")
> effectSize <- retDbm$ciDiffTrtRRRC$Estimate
> varCompDBM <- retDbm$varComp
> varYTR <- varCompDBM$varComp[3]
> varYTC <- varCompDBM$varComp[4]
> varYEps <- varCompDBM$varComp[6]
> SampleSizeGivenJ(J = 6, varYTR = varYTR, varYTC = varYTC, varYEps = varYEps,
+                  effectSize =effectSize)
$K
[1] 251

$power
[1] 0.8005403

> 
> ## Following is an example of sample size calculation with OR variance components.
> retOR <- ORHAnalysis(data = rocData, fom = "Wilcoxon", covEstMethod = "Jackknife")
> effectSize <- retOR$ciDiffTrtRRRC$Estimate
> varCompOR <- retOR$varComp
> cov1 <- varCompOR$varCov[3]
> cov2 <- varCompOR$varCov[4]
> cov3 <- varCompOR$varCov[5]
> varEps <- varCompOR$varCov[6]
> msTR <- retOR$msTR
> KStar <- 114
> SampleSizeGivenJ(J = 6, cov1 = cov1, cov2 = cov2, cov3 = cov3, varEps= varEps,
+                  msTR = msTR, KStar = KStar, effectSize =effectSize)
$K
[1] 251

$power
[1] 0.8005403

> 
> ## Not run: 
> ##D ## Following is an example of sample size calculation with DBM variance components,
> ##D ## and scanning the number of readers
> ##D retDbm <- DBMHAnalysis(data = rocData, fom = "Wilcoxon")
> ##D effectSize <- retDbm$ciDiffTrtRRRC$Estimate
> ##D varYTR <- retDbm$varComp$varComp[3]
> ##D varYTC <- retDbm$varComp$varComp[4]
> ##D varYEps <- retDbm$varComp$varComp[6]
> ##D effectSize <- retDbm$ciDiffTrtRRRC$Estimate
> ##D for (J in 6:10) {
> ##D  ret <- SampleSizeGivenJ(J, varYTR, varYTC, varYEps, effectSize =effectSize)
> ##D  message("# of readers = ", J, " estimated # of cases = ", ret$K, ", predicted power = ",
> ##D     signif(ret$power,3), "\n")
> ##D }
> ##D 
> ##D ## Following is an example of sample size calculation with OR variance components,
> ##D ## using bootstrap to estimate variance components
> ##D retOR <- ORHAnalysis(data = rocData, fom = "Wilcoxon", covEstMethod = "Bootstrap")
> ##D effectSize <- retOR$ciDiffTrtRRRC$Estimate
> ##D varCompOR <- retOR$varComp
> ##D cov1 <- varCompOR$varCov[3]
> ##D cov2 <- varCompOR$varCov[4]
> ##D cov3 <- varCompOR$varCov[5]
> ##D varEps <- varCompOR$varCov[6]
> ##D msTR <- retOR$msTR
> ##D KStar <- length(rocData$NL[1,1,,1])
> ##D SampleSizeGivenJ(J = 6, cov1 = cov1, cov2 = cov2, cov3 = cov3, varEps= varEps,
> ##D                  msTR = msTR, KStar = KStar, effectSize =effectSize)
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>