Closed pgcudahy closed 5 years ago
This is because you have an implied "threshold" in the default value of ret
.
This will work right away, setting the return value without threshold:
> ci.coords(roc1, 5, input="threshold", ret=c("se", "sp"))
|======================================================================| 100%
95% CI (2000 stratified bootstrap replicates):
2.5% 50% 97.5%
threshold 5: sensitivity 0.8 0.9333 1
threshold 5: specificity 0.2 0.6000 1
The threshold itself won't vary.
However in this case it should indeed be possible to return a (constant) threshold. I will investigate why it isn't the case.
In addition the default value should probably be able to auto-detect whether 'threshold' can be computed.
Thanks! Your solution works for me. I'm still a little confused, since a threshold is given by the user, what does it mean for the function to return a threshold, other than just show the input value? Shouldn't ret=c("se", "sp") be the default if the input is a threshold?
I'm not sure if it should be the default. It's useful to ping it back in the case where many thresholds are given as input.
Fixed. Threshold is kept by default whenever possible, and removed from the return values otherwise. I will attempt to push this to CRAN as 1.15.1 soon.
Describe the bug When trying to use ci.coords with
input="threshold"
I get an error regardingret="threshold"
To Reproduce
Gives the error
Expected behavior A confidence interval for sensitivity and specificity at the chosen threshold.
Additional context I can see why choosing a return threshold generates an error. But this is an input threshold.