Thie1e / cutpointr

Optimal cutpoints in R: determining and validating optimal cutpoints in binary classification
https://cran.r-project.org/package=cutpointr
85 stars 13 forks source link

direction parameter in the cutpointr() #59

Closed jwang-lilly closed 1 year ago

jwang-lilly commented 1 year ago

Dear Dr. Thiele @Thie1e

We have a quick question about allowable inputs for parameters of cutpointr(). direction currently only accepts" >=" or "<=" but not ">" or "<". We are trying to match the cutpointr output with output from another tool and we figured out the difference in the ">=" in cutpointr and ">" in the other tool. Is there any way we can set ">" in cutpointr()? Any advice is greatly appreciated.

Thanks so much for your help.

Thie1e commented 1 year ago

Hi Jiang,

unfortunately, I have only implemented >= and <=.

The difference between > and >= matters only with few unique values (as in the example suicide dataset) and if use_midpoints = FALSE.

For that reason and because this feature was not requested thus far, I have not implemented it and also do not plan to do so – unless there is a good argument why it is needed. You are mainly interested in comparing the results to a different tool, right?

So you can unfortunately not set direction = ">", but you could try setting use_midpoints = TRUE which should bring the optimal cutpoint closer to the one that would be obtained with direction = ">" and use_midpoints = FALSE.

(I think with use_midpoints = TRUE the optimal cutpoint would actually be identical with > and >=)

Best, Christian

jwang-lilly commented 1 year ago

Thanks very much Christian. This is very helpful!