-
Notifications
You must be signed in to change notification settings - Fork 2
/
22-zero-non-diseased-cases.Rmd
64 lines (43 loc) · 2.33 KB
/
22-zero-non-diseased-cases.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Analyzing a dataset with only diseased cases {#analyze-diseased-only-dataset}
---
output:
rmarkdown::pdf_document:
fig_caption: yes
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
eval.after = "fig.cap"
)
library(RJafroc)
```
## TBA How much finished {#analyze-diseased-only-dataset-how-much-finished}
0%
## The problem {#analyze-diseased-only-dataset-methods}
How to analyze $K_1 = 0$ datasets.
ROC-like plot of TPF vs. FPF1 is possible, see Section \@ref(empirical-definition-empirical-auc-afroc1). Can create a ROC-like dataset with equal number of "non-diseased" and diseased cases (the ratings of the non-diseased cases are the FP ratings on diseased cases). Fit RSM to this dataset. Proceed as before. Key assumption being violated: the FP ratings on diseased cases are independent of the TP ratings on same cases. However, without this assumption one cannot estimate RSM parameters. Need `RJafroc` function to handle this special case: `FitRsmRoc1`? No! Just need function to create a "ROC" dataset from one that only has diseased cases. e.g., `DfNoNormalsDataset`?
### Step 1: Create a test (diseased cases only) dataset {#analyze-diseased-only-dataset-step-1}
Save TONY dataset to `dsTony`. Create copy `dsNoNormals`. Remove all normal cases from it.
```{r analyze-diseased-only-code, echo=TRUE}
dsTony <- RJafroc::dataset01 # TONY dataset
K2 <- length(dsTony$lesions$perCase)
K1 <- length(dsTony$ratings$NL[1,1,,1]) - K2
dsNoNormals <- dsTony
# Remove all normal cases
dsNoNormals$ratings$NL <- dsNoNormals$ratings$NL[,,-(1:K1),]
# And fix truthTableStr
dsNoNormals$descriptions$truthTableStr <-
dsNoNormals$descriptions$truthTableStr[,,-(1:K1),]
RJafroc::UtilFigureOfMerit(dsTony,FOM = "wAFROC")
#RJafroc::UtilFigureOfMerit(dsNoNormals,FOM = "wAFROC") #this will generate an error
RJafroc::UtilFigureOfMerit(dsTony,FOM = "wAFROC1")
RJafroc::UtilFigureOfMerit(dsNoNormals,FOM = "wAFROC1")
st <- St(dsTony,FOM = "wAFROC")
st1 <- St(dsNoNormals,FOM = "wAFROC1")
st$RRRC
st1$RRRC
```
* `dsNoNormals` is the dataset with no non-diseased cases.
* `st` contains the results of significance testing using the wAFROC-AUC figure of merit for the full dataset.
* `st1` contains the results of significance testing using the wAFROC1-AUC figure of merit for the dataset with no non-diseased cases.