File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ nonParametricPV <- function(outcome, score) {
32
32
thresh.predictions <- lapply(score , function (x ) as.numeric(score > x ))
33
33
34
34
ppv <- vapply(
35
- thresh.predictions [ 1 : (length( score ) - 1 )] ,
35
+ thresh.predictions ,
36
36
function (x ) {
37
37
yardstick :: ppv_vec(
38
38
truth = factor (outcome , levels = c(" 1" , " 0" )),
@@ -44,7 +44,7 @@ nonParametricPV <- function(outcome, score) {
44
44
)
45
45
46
46
npv <- vapply(
47
- thresh.predictions [ 1 : (length( score ) - 1 )] ,
47
+ thresh.predictions ,
48
48
function (x ) {
49
49
yardstick :: npv_vec(
50
50
truth = factor (outcome , levels = c(" 1" , " 0" )),
@@ -58,8 +58,8 @@ nonParametricPV <- function(outcome, score) {
58
58
threshold.data <- data.frame (
59
59
score = score ,
60
60
percentile = ecdf(score )(score ),
61
- PPV = c( prev , ppv ) ,
62
- NPV = c( npv , 1 - prev )
61
+ PPV = ppv ,
62
+ NPV = npv
63
63
) %> %
64
64
mutate(MNPV = 1 - .data $ NPV ) %> %
65
65
tidyr :: fill(
You can’t perform that action at this time.
0 commit comments