# NOT RUN {
## Following is an example of sample size calculation using the DBM variance
## components and jackknifing (the default) to
## estimate the variance components
retDbm <- StSignificanceTesting(data = dataset02,
FOM = "Wilcoxon", method = "DBMH")
effectSize <- retDbm$ciDiffTrtRRRC$Estimate
varCompDBM <- retDbm$varComp
varYTR <- varCompDBM$varComp[3]
varYTC <- varCompDBM$varComp[4]
varYEps <- varCompDBM$varComp[6]
SsSampleSizeKGivenJ(J = 6, varYTR = varYTR, varYTC = varYTC, varYEps = varYEps,
effectSize =effectSize)
## Following is an example of sample size calculation using the OR variance components
retOR <- StSignificanceTesting(data = dataset02, FOM = "Wilcoxon",
covEstMethod = "Jackknife", method = "ORH")
effectSize <- retOR$ciDiffTrtRRRC$Estimate
varCompOR <- retOR$varComp
varTR <- varCompOR$varCov[2]
cov1 <- varCompOR$varCov[3]
cov2 <- varCompOR$varCov[4]
cov3 <- varCompOR$varCov[5]
varEps <- varCompOR$varCov[6]
KStar <- 114
SsSampleSizeKGivenJ(J = 6, cov1 = cov1, cov2 = cov2, cov3 = cov3, varTR = varTR, varEps= varEps,
KStar = KStar, effectSize =effectSize, method = "ORH")
# }
# NOT RUN {
## Following is an example of power calculations using the DBM variance components,
## and scanning the number of readers
retDbm <- StSignificanceTesting(data = dataset02,
FOM = "Wilcoxon", method = "DBMH")
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 <- SsSampleSizeKGivenJ(J = J, varYTR = varYTR, varYTC = varYTC,
varYEps = varYEps, effectSize =effectSize)
message("# of readers = ", J, " estimated # of cases = ", ret$K, ", predicted power = ",
signif(ret$powerRRRC,3), "\n")
}
## Following is an example of power calculations using the ORH variance components,
## using bootstrap to estimate variance components
retOR <- StSignificanceTesting(data = dataset02, FOM = "Wilcoxon",
covEstMethod = "Bootstrap", method = "ORH")
effectSize <- retOR$ciDiffTrtRRRC$Estimate
varCompOR <- retOR$varComp
varTR <- varCompOR$varCov[2]
cov1 <- varCompOR$varCov[3]
cov2 <- varCompOR$varCov[4]
cov3 <- varCompOR$varCov[5]
varEps <- varCompOR$varCov[6]
KStar <- length(dataset02$NL[1,1,,1])
SsSampleSizeKGivenJ(J = 6, cov1 = cov1, cov2 = cov2, cov3 = cov3,
varTR = varTR, varEps= varEps,
KStar = KStar, effectSize =effectSize, method = "ORH")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab