R package MRMCaov.StORAnalysis disabled for XMod analysisStSignificanceTesting to St
StSignificanceTestingCadVsRad to StCadVsRad
UtilVarComponentOR to UtilOrVarCov
UtilVarComponentsDBM to UtilDBMVarComp
UtilOutputReport.R as St output has been updated so this function is no longer needed.goodValues; reinitialized affected ones.truthTableStr is used more consistently (except for LROC and ROI paradigms where this is set to NA).dataset11 has unusual lesion distribution: there are 14 elements but they range from 1 to 20 with some lesionIDs missingtest_cpp_vs_R where I compare cpp to R implementations; TODORSM_FPF and RSM_TPF
RSM_xROC and RSM_yROC
rsmFormulae.R
RSM_LLF, RSM_wLLF, RSM_FPF, RSM_TPF, RSM_NLF. These now match the usage in RJafrocFrocBook
lesDistr vector, too complexgeom_line() occurs, check that size aesthetic is replaced by linewidth
ggplot object structure 10/25/22ggplot2 installed by the following linedevtools::install_github('tidyverse/ggplot2@v3.4.0-rc')developer into master branchUtilAnalyticalAucsRSM_R function which does not use Cpp codetempTest flag in UtilAnalyticalAucsRSM; this uses Cpp❯ checking dependencies in R code ... WARNING
'::' or ':::' import not declared from: ‘R’
y_ROC_FPF_R generating a warning? This function is not called anywhere, so I commented it out; the warning disappearslambdaP to lambda and lambda to lambda_i 9/19/22PlotRsmOperatingCharacteristics depends on RSM parameters, not intrinsic parameters 9/22/22test-LROCFomCheck.R could not resolve in time 9/22/22lesDistr = 1 in PlotRsmOperatingCharacteristics as we don’t want user to have to input this value when it is not needed for the requested operating characteristic (e.g., FROC or AFROC).cran210 branch.RoiData.xlsx.developer and master as of 07/7/22.lesDist and relWeights 7/19/22lesDist, it is now always 1DUtilLesDistrVector.R and UtilLesionWeightsMatrix.R
lesDistr and relWeight must have same lengths and sum to unityrelWeight = 0 imposes equal weightsCh19Vig1FrocSampleSize.Rmd 6/7/22Ch19Vig2FrocSampleSize.Rmd and Ch19Vig2FrocSampleSize.Rmd
DfWriteExcelDataFile 3/15/22DfSaveDataFile; it is now in DfWriteExcelDataFile
JT_R_Py_Foms.xlsx in PyJafrocscraps directorytest-RSM-formulae.R
rsm-pred-wafroc-curve: rsmFormulae.R and UtilAnalyticalAucsRSM.R
RJafrocFrocBook, search for rsm-pred-wafroc-curve
developer and master
RJafrocFrocBook, chapter on 3-fits
RsmFormulae.R: This file is a mess.PlotRsmOperatingCharacteristics? - these are done in UtilAnalyticalAucsRsm
RSM_yROC to accept physical parameters 12-26-21RSM_xROC
RJafrocFrocBook, chapter on 3-fits
RsmFormulae.R .RsmFormulae.R to accept physical parameters.PlotRsmOperatingCharacteristics not working for zeta1 = -Inf
-Inf; detect it and set to -3PlotRsmOperatingCharacteristics returning correct plots but incorrect AUCszeta1 = -20 instead of the supplied value.truthTableStr in any file *.imrc when read by DfReadDataFile.tests: StSignificanceTestingCadVsRad: Issue T1-RRRC for ROC data #73 for recreation of this issue.R and RStudio.DfExtracDataset.R was also affected: the change fixes an error that did not get caught before.StSignificanceTestingCadVsRad.R.readerID and modalityID fields must be unique integers, as indicated in documentation of DfReadDataFile().*.lrc, *.txt, *.csv and *.imrmc) for the simplest data structure (one rating for each modality-reader-case). This is unnecessarily complicating the code. Final resolution: I will support only *.imrmc. Other formats can still be read by DfReadDataFile() and then saved to a JAFROC format file for analysis within the RJafroc package.DfReadDataFile to accommodate LROC data; added flag lrocForcedMark
newExcelFileFormat = T for this capabilityinst/extdata/toyFiles/LROC/lroc*.xlsx
ReadJAFROCNewFormat.R, just before final return, for added codetest-DfReadDataFile().Ch19Vig1FrocSampleSize.Rmd and Ch19Vig2FrocSampleSize.Rmd
SsFrocNhRsmModel.R to not return lesion distribution and weightsSsFrocNhRsmModel.R to do binning internal to the functionSsFrocNhRsmModel().Rcpp to 1.0.6. NOTE: version 1.0.6.6 created horrendous errors - R aborts.RSM_xROC and RSM_pdfN)PlotRsmOperatingCharacteristics.R,UtilAnallyticalAucsRSM.R,rsmFormulae.Rtest-RSM-formulae.R and test-model-aucs.R
goodValues to check that nothing has changedcran3 branch.tests and vignettes (this needs to be done on all computers I am using).inst/MRMCRuns except Tony, the one that is used in an example.CrossedModalities.xlsx and references to it.DfReadLrocDataFile.R and findings.txt. Ran devtools::document() to fix NAMESPACE.RoiData.xlsx.developer and master as of 12/8/20.testthat failure on Ubuntu developer is resolved, see master branch: checkEnvironment = FALSE in expect_equal() on ggplot2 comparisons to goodValues.lesDistr and relWeights.UtilSpecifyLesionWeightsDistr
Convert2lesDistr
lesDistr
relWeights
UtilSpecifyLesionWeightsDistr() which is distinct from UtilLesionWeightsDistr(), as the latter works on datasets.UtilAucRSM() to UtilAnalyticalAucsRSM() to distinguish from UtilFigureOfMerit() which works on datasets.Convert2lesDistr() to save me time converting from 1D lesion distribution to 2D version which is the standard in the rest of the package. It is currently not called anywhere.zeta1 dependence to UtilAnalyticalAucsRSM().StSignificanceTestingCadVsRad()
RJafrocBook
DualModalityRRRC()
seed behaviour, no need for SimulateFrocDatasetNoSeed()
14-froc-meanings-xx.Rmd chapter.seed is not supplied, then SimulateFrocDataset() behaves as before the Nov 17 changeseed to SimulateFrocDataset()seed in order to reproduce FROC datasets.test files.seed to other simulation functions.Toy file with no non-diseased cases: frocLocatClass.xlsx.
Symptom: UtilFigureOfMerit, with “wAFROC1” FOM failed in C++ code in function double wAFROC1() with message Not compatible with requested type: [type=character; target=double]
The problem was traced to ReadJAFROCOldFormat.R (I was using OldExcelFileFormat) which was returning NL and LL as characters, not numerics.
Fix: convert NL and LL from character using as.numeric.
NLRating <- as.numeric(NLTable[[4]])
LLRating <- as.numeric(LLTable[[5]])
NewExcelFileFormat, which gave following error: stop("Error in reading LL/TP table") Replaced code in ReadJAFROCNewFormat.R as follows:if (is.na(tt2)) next else { # this is the change
if (tt2 != 1) stop("Error in reading LL/TP table") else
# the is.na() check ensures that an already recorded mark is not overwritten
if (is.na( LL[i, j, k, el])) LL[i, j, k, el] <- LLRatingCol[l]
}
# if (is.na(tt2)) stop("Error in reading LL/TP table") else {
# if (tt2 != 1) stop("Error in reading LL/TP table") else
# # the is.na() check ensures that an already recorded mark is not overwritten
# if (is.na( LL[i, j, k, el])) LL[i, j, k, el] <- LLRatingCol[l]
# }
Also replaced
el <- which(unique(truthTableSort$LesionID) == LLLesionIDCol[l]) - 1
with
if (K1 != 0) {
# this gives 0,1,2,..,max num of lesions
# which includes zero, hence the minus 1
el <- which(unique(truthTableSort$LesionID) == LLLesionIDCol[l]) - 1
} else {
# this gives 1,2,..,max num of lesions
# which does not include zero, hence no minus 1
el <- which(unique(truthTableSort$LesionID) == LLLesionIDCol[l])
}
test-UtilFigureOfMerit.R
DfReadDataFile.R in function checkTruthTable(); this bug discovered in working with HUGE one reader dataset.I <- length(strsplit(modalityIDCol[1], split = ",")[[1]]) and similar expression for J.as.character as in: readerIDCol <- as.character(truthTable$ReaderID) # bug fix to avoid non-character input error below
modalityIDCol <- as.character(truthTable$ModalityID) # do:
RJafrocBook.PlotEmpiricalOperatingCharacteristics.R.gpfPlotGenericEmpiricalOperatingCharacteristic.R files in inst/fixPlots.ggplot2
with function usage in this function: hard to tell what is going on and the help page on this function seems to discourage this type of usage in packagesgenAbscissa, genOrdinate, Reader, Modality.ggplot2 related issue.gpfPlotGenericEmpiricalOperatingCharacteristic function to NULLs.CI for individual treatments averaged over readers;inst/Iowa/VanDyke.txt, as I cannot find a better reference for the equations used.DfSaveDataFile.R as it creates non-standard files in doc directory; this did not happen before the R update.test-PlotEmpiricalOperatingCharacteristics.R.MaxNLF, MaxLLF, HrSe, HrSp, etc. Resolved after studyin XZ code, StOldCode.R. The handling is shown in UtilPseudoValues.R. I believe it is now correct. For MaxNLF, HrSp, and ExpTrnsfmSp the relevant number of cases is K1, for MaxLLF and HrSe it is K2 and for all the rest it is K.FOMijk2VarCovSpA and FOMijk2VarCov to accept a varInflFactor logical argument, allowing jackknife, bootstrap and DeLong - based estimates to be more compactly handled.dataset05 MaxLLF MaxNLF vs. JAFROCdescriptions$fileName. This fixed problem with expect_equal() failing depending on how the goodValues were generated - from R command line vs. Run Tests. Also, in creating a dataset object, where appropriate, fileName <- “NA” instead of fileName <- NA; the latter generates a character expected error when an attempt is made to strip path name and extension in convert2dataset and convert2Xdataset.MaxNLFAllCases FOM; see comments in UtilMeanSquares(); regenerated one goodValue file.UtilOutputReport() for text output onlyinst to Dropbox.DfReadDataFile.R and testing code for non-sequential lesionIDs in TRUTH worksheet.grep.RJafroc to Iowa softwaretest-StCompare2Iowa.R in testthat directory.RJafroc to results of OR-DBM MRMC 2.51 Build 20181028 for VanDyke and Franken datasets.RJafroc software is checked using R CMD check.Var(R) and Var(TR) values reported by OR-DBM MRMC 2.51 Build 20181028 and RJafroc for Franken dataset.max(Cov2 - Cov3, 0) constraint while RJafroc does.RJafroc reports VarTR = -0.00068389146 while their code reports VarTR = -0.00071276.msTR - Var + Cov1 + max(Cov2 - Cov3, 0) = -0.00068389146 and msTR - Var + Cov1 + Cov2 - Cov3 = -0.00071276.VarR values (see block of comments in UtilORVarComponentsFactorial near line 161). Cov1, Cov2, Cov3 and Var are the same between both codes.pss20190918.jar).LegacyCode flag is provided to force execution of the original DBM method (2004 paper).Var(TR). Noticed a small difference in predicted power between forced DBM (0.78574588) and OR methods (0.8004469).SsPowerGivenJKDbmVarCom.UpdateSsRoutines off the developer branch.developer branch and then to the master branch.dataset structuredatasets now are lists of length 3, with each member (ratings, lesions, descriptions) consisting of sub-lists:
ratings contain 3 elements: $NL, $LL and $LL_IL.$lesions contains 3 elements: $perCase, $IDs and $weights.$descriptions contains 7 elements: $fileName, $type, $name, $truthTableStr, $design, $modalityID and $readerID.SimplifyDatasets off the developer branch.developer branch and then to the master branch.St functionsRRRC branches etc to separate files; likewise for DBM and OR branches, now the files are much shorter and easier to maintainlist of dataframes, see next comment; this makes for much cleaner and easier printingSt functions: list with data frames FOM, ANOVA, RRRC, FRRC and RRFC.tests/testthat/test-St-Compare2Iowa.R for VanDyke datasetRJafroc results against OR-DBM MRMC 2.51 for dataset04 converted to ROC (see Iowa code results in inst/Iowa/FedRoc.txt);UtilOutputReport considerably, by using print(dataframe) instead of reading values from list or dataframe variables and then using sprintf with unreadable C-style format codesmaster branchmaster branch if it passes TravisPlotEmpiricalOperatingCharacteristics, where factors and levels are usedtest as otherwise different versions will give factors or characters and not match those in goodValues folderoptions(stringsAsFactors = FALSE) at beginning of a function, e.g., StSignificanceTesting, passes this option onto called functions, e.g, StDBMHAnalyis
getOption("stringsAsFactors") to determine state of this option; must restart R to obtain default value (TRUE on the release version); calling a function that sets it to FALSE keeps the new value after exiting from function; must restart R again to get proper default.stringsAsFactors explicitly for each data.frame call, due to different defaults in different verions of R
options("stringsAsFactors" = TRUE), as this is deprecated
stringsAsFactors arguments in all calls except…PlotEmpiricalOperatingCharacteristics, where factors are usedR3.6.3 option($stringsAsFactors) = TRUE (stringsAsFactors is case sensitive!)SsPowerTable() should set options(stringsAsFactors = FALSE) explicitly at the beginning of the code, in order to work in current and previous version of R (i.e., release and old-release)PlotRsmOperatingCharacteristics and FitCorCbmRoc) should set options(stringsAsFactors = TRUE) in order to work in developer version of R, where default is options("stringsAsFactors") = FALSE
transpose for foms member of StSignificanceTesting return objectmrmc_setup_w10_July_2019.exe; VanDyke VanDyke.lrc dataset; Dropobox/IowaSoftware/VanDyke.lrc
OR DBM MRMC 2.51 <beta> Build 20181028 </beta> miplmrmc
VmWare Fusion; no luck, even after following directions twice on website
StSignificanceTesting - WIPStSignificanceTesting(dataset02, method = "OR", option = "FRRC") - donetestthat all combinations of method and option - doneStSignificanceTesting depending on choice of option - almost doneRJafrocBook is klutzy - WIPUtilVarComponentOR to allow comparison with RJafrocBook
covEstMethod = jackknife, bootstrap and DeLong for two datasetsdataset02 and dataset04 converted to ROCmaster so that RJafrocBook code passes TravisRJafrocBook
RJafroc to eliminate code duplication and improve style in all significance testing functions - move this to issuesRJafrocBook)StSignificanceTesting(rocData1R, FOM = "Wilcoxon", method = "OR")
StSignificanceTestingSingleFixedFactor which currently only handles DBM method - add to issuesStSignificanceTesting to J > 1master so that RJafrocBook code passes TravismsTC
msTC calculation in UtilMeanSquares
RJafocBook, DBM chaptercovEstMethod argument to OR method to lower case (“jackknife” or “bootstrap”)optim when flipping groupsRJafroc/master
FZ_ALL.xlsx) from extdata/datasets so I dont get file size error (extdata was 2.5 MB, reduced to 1.3)Compare3ProperRocFits.R
RJafrocBook)StDBMHAnalysis.R that fixed test that I had to skip on mac for context("SignificanceTestingAllCombinations"). Need to get this fix (lines 45-51) over to cran2 branch as I am thinking of splitting the package up by separating the cran2 branch as the base package RJafroc and depending on RJafroc for new package RJafroc2. This would solve the file size problems that I am running into. Just an idea.developer branch on GitHub and merged with master.cran2 1.3.1 called cran2-fix
options(stringsAsFactors = FALSE)
R CMD check I set options(stringsAsFactor=FALSE) near beginning of each plotting function (3 functions) using data.frame() and levels() to convert strings to factor levelsstringsAsFactor=TRUE in each call to data.frame() where necessary.R CMD check successfullycran2-update/master branch for content relating to this versiondevelopment branch while using GitHub; decided to do Git manually.gitignore not working?DfReadDataFile()
DfReadDataFile() is usedUtilMeanSquares() line 88 msTC <- msTC * J/((I - 1) * (Ktemp - 1)) has been correctedtest-StSignificance-testing.R at line 128PlotEmpiricalOperatingCharacteristics() now accepts ROC, FROC and LROC datasets.legPos argument to allow better positioning of legend.Ch19Vig1FrocSampleSize.Rmd: Compares FROC power to ROC power.Ch19Vig2FrocSampleSize.Rmd: FROC power calculation for a number of situations.SsFrocNhRsmModel(): constructs an RSM-based model, which allows one to relate an ROC effect size to a wAFROC effect size, and returns parameters of model to allow FOM estimation for ROC and wAFROC. Following functions are used to calculate the lesion distribution and lesion weights arrays:UtilLesionDistribution: renamed to UtilLesionDistr
UtilLesionWeightsDistr:StSignificanceTesting(): corrects errors affecting method = "OR" and covEstMethod = "Jackknife". I messed up while trying to simplify XZ code. It calls:JAFROC on virtual Windows 8 machine and saved results (inst/VarCompDiscrepancy/includedFrocData_Inferred_ROC.txt) to validate current significance testing functions. Included unit tests in tests/testthat.StOldCode.R) to compare against current significance testing code. Included unit tests in tests/testthat.gpfMyFOM(): interpolation error in LROC PCL and ALROC FOMs. Hand calculations showed that the approx function did not work for small datasets. Wrote my own simple interpolation code. See LrocFoms() in gpfMyFOM.R. See ChkLrocFoms.xlsx in inst/StSigTesting for details on hand calculation of LROC FOMs.FPFValue, 0.2 or less.
FPFValue to accommodate LROC datasets.StSignificanceTestingCadVsRadiologists(): CAD results updated (only values for FPFValue 0.2 or less were affected); see CadFunctionTests.R in inst/CadTesting. See CadTestingNicoData.xlsx in inst/CadTesting. Included unit tests in tests/testthat.StSignificanceTestingCadVsRadiologists(): cleaned up and now runs all FOMs.SimulateLrocDataset(): FROC to LROC simulator based on RSM. Could be used for NH testing. RSM can now predict all paradigm data.DfFroc2Lroc(): Simulates an “AUC-equivalent” LROC dataset from an FROC dataset. This is neat!DfLroc2Froc(): Simulates an “AUC-equivalent” FROC dataset from an LROC dataset.DfLroc2Roc(): convert LROC dataset to ROC dataset.dataset2ratings() has been corrected.SignificanceTesting functions now accept variance components, without having to specify a dataset.UtilVarComponentsDBM():UtilORVarComponentsFactorial():SsPowerGivenJKDbmVarComp:SsPowerGivenJKOrVarComp:SsSampleSizeKGivenJ:SsPowerGivenJK:StSingleTreatmentRandomReader:FPFValue argument immediately follows FOM, where applicable.addPlot routine in StSignificanceTestingCadVsRadiologists has been renamed to CadVsRadPlots(). It should be deprecated in future as PlotRsmOperatingCharacteristics() has more consistent visual output (and capabilities like handling lists of treatments and readers).isValidFom?SimulateLrocDataset() predict both flattening out of LROC plot and wAFROC going to (1,1)?RJafroc (note capitalization)Solaris failure (Peter Philips)UtilPseudoValues.R that was caught by testthat
StSignificanceTesting.R that was caught by testthat (Peter Philips)R CMD check generates testthat failure when run under RStudio, see following output, but not when run as devtools::test():* checking tests ...
Running ‘testthat.R’ [158s/160s]
ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
Component "Source": Attributes: < Component "levels": 3 string mismatches >
List member = 2, Dataset = dataset02, FOM = Wilcoxon, method = DBM
── 2. Failure: SignificanceTestingAllCombinations (@test-significance-te
CurrentValues[[listMem]] not equal to GoodValues[[listMem]].
Component "Source": Attributes: < Component "levels": 3 string mismatches >
List member = 2, Dataset = dataset05, FOM = HrAuc, method = DBM
travis-ci testing after each push; and build passing badges, etc.caTools package, which was not being supported; extracted function trapz() from it and inserted directly into gpfMyFOM.R - see comments in that file of what led to thisxlsx package, which requires rJava and JAVA, replaced with dependence on openxlsx package. Was having difficulty installing rJava correctly after each OSX or R update.UtilOutputReport.R.UtilOutputReport that was preventing overwriting of existing output file, even when the user keys “y” in response to promptCORCBM, fitting and related functions to make package current with 2017 CORCBM publication.PlotEmpiricalCharacteristics.R that was giving incorrect plots for other than ROC and wAFROC plotsChisqrGoodnessOfFit function, replacing 3 functionsgenericPlotROC.R instead of 3 functionsExampleCompare3ProperRocFits() to Compare3ProperRocFits()
Compare3ProperRocFits()
QuickStartDBMH and QuickStartDBMHExcelOutput
revdep("rjafroc") yields character(0)
SsFROCPowerGivenJK: FROC power is implemented in Online Appendix Chapter 19 (see email exchange with Kota Aoyagi)A “shiny” based GUI has been added, accessed by the function RJafrocGui(). This allows a user only interested in analyzing a data file to access the underlying code in a “user friendly” way. The GUI is similar in functionality to that of Windows JAFROC 4.2.1 software.
For the curve plotting functions, legend position and direction are automatically decided if they are not explicityly specified.
The the output number of significant digits for statistical power in power table has been set to 3.
Variance and covariance calculation error for ROI data has been fixed.
A bug in the JAFROC data reading function that caused an error when encountering non-numeric values has been fixed.
Floating point ratings are rounded to 6 significant digits when saving a dataset in JAFROC format.
A bug in the plotting routine that affected plots for a single rating FROC dataset has been fixed.
A bug in the plotting of AFROC curves for a dataset containing only non-diseased cases has been fixed.