dpc10ster / RJafroc

Artificial Intelligence: Evaluating AI, optimizing AI
19 stars 8 forks source link

Variance components and sample size #33

Closed dpc10ster closed 5 years ago

dpc10ster commented 5 years ago

A user noted a discrepancy in the variance components reported by StSignificanceTesting().

dpc10ster commented 5 years ago

Working on new branch VarCompDiscrepancy off SplitPlot; reason: see above comment.

dpc10ster commented 5 years ago

Branched OldCode off VarCompDiscrepancy to resolve issue raised above. Found that the ORH branch of StSignificanceTesting (but using jackknife for estimating the covariance matrix), was not giving same results as the DBMH branch. Included in OldCode.R the original Xuetong Zhai R code from first CRAN published version of RJafroc (this version, 0.0.1, does not have any C++ code and is easier to understand). Also ran JAFROC on Windows 8 virtual machine. Found the only discrepancy was in the ORH branch of the current code. Simplified this code considerably. Took out the option of passing variance components as an alternative to passing the pilot dataset. This was complicating the code (needing variable length argument passing methods, the ... seen in many R functions) and making it harder to use (e.g., the order of the passed arguments was critical). In the revised code only the pilot dataset is passed, and the needed variance components are calculated from it. The affected functions/files are:

StSignificanceTesting(dataset, FOM, FPFValue = 0.2, alpha = 0.05,
  method = "DBMH", covEstMethod = "Jackknife", nBoots = 200,
  option = "ALL", tempOrgCode = FALSE)

StORHAnalysis .R
StDBMHAnalysis.R 
OldCode.R

While working on this I received an email from a researcher noting an error in the sample size routine mainwAFROCPowerDBMH.R in Online Appendix 19 and expressing interest in FROC sample size method for CAD vs. radiologists.

“Error in SsPowerGivenJK(JTest, KTest, alpha = 0.05, effectSize = effectSizeROC[i],  :
  object 'ret' not found”

The sample size routine was limited to ROC paradigm. So I needed to extend it to FROC paradigm.

dpc10ster commented 5 years ago

Summary of updates:

This now works for all data types (LROC, FROC and FROC).

These functions allow testing StSignificanceTestingCadVsRadiologists using a CAD vs. RAD FROC datasets. Prior to this only one CAD vs. RAD LROC dataset was available. A future update will include an LROC data simulator based on the RSM.

This was fixed to handle all data types. The FPFValue argument is only needed for LROC datasets.

  PCL <- (approx(lroc$FPF, lroc$PCL, xout = FPFValue, ties = min))$y # post version 1.1.0
  # the ties argument above removes the warnings I was getting like:
  ## Warning message: 
  ## In regularize.values(x, y, ties, missing(ties)) :
  ##   collapsing to unique 'x' values 
  # but the FOM changed slightly, e.g. from 0.4625 to 0.45 for PCL-0.05
  # also ALROC-0.05 changed slightly 
  # No changes noted for 0.2 and 1.
dpc10ster commented 5 years ago

Variance component and sample size issues resolved