## 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)
Run the code above in your browser using DataLab