I basically need the equivalent of a SUMIF in excel here because I already have the True Positive Rate aka sensitivity, False Positive Rate, and True Negative Rate aka specificity (because TNR = 1- FPR) for each of the N LASSOs I have ran on a corresponding set of N datasets which look like this:
> head(BM1_TPRs)
[[1]]
[1] 1
[[2]]
[1] 1
[[3]]
[1] 0.6666667
[[4]]
[1] 1
… N
> head(BM1_FPRs)
[[1]]
[1] 0
[[2]]
[1] 0
[[3]]
[1] 0
[[4]]
[1] 0
.
.
.
N
> head(BM1_TNRs)
[[1]]
[1] 1
[[2]]
[1] 1
[[3]]
[1] 1
[[4]]
[1] 1
.
.
.
N
And now, I need functions or a function which can count up how many models selected have at least one omitted variable and no extraneous variables, that is, TPR < 1, and FPR = 0 (or equivalently TRN = 1).
p.s. I could also really use a function which calculates/counts the total number of correctly specified models selected, that is, those for which TPR = 1 and FPR = 0.