Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor all-in-one plot calls #70

Open
xrobin opened this issue Jan 6, 2020 · 0 comments
Open

Refactor all-in-one plot calls #70

xrobin opened this issue Jan 6, 2020 · 0 comments

Comments

@xrobin
Copy link
Owner

xrobin commented Jan 6, 2020

The all-in-one calls are difficult to maintain and to test. For instance all the *.formula methods are a mess. Functions such as ci or auc should not create ROC curves, and the ROC function shouldn't plot and calculate CI.

For instance, replace the following example in ?pROC:

roc(aSAH$outcome,
	aSAH$s100b, percent=TRUE,
	# arguments for auc
	partial.auc=c(100, 90), partial.auc.correct=TRUE,
	partial.auc.focus="sens",
	# arguments for ci
	ci=TRUE, boot.n=100, ci.alpha=0.9, stratified=FALSE,
	# arguments for plot
	plot=TRUE, auc.polygon=TRUE, max.auc.polygon=TRUE, grid=TRUE,
	print.auc=TRUE, print.thres= "best")

By a more modular call such as:

roc.s100b <- roc(aSAH$outcome, aSAH$s100b, percent = TRUE)
auc.s100b <- auc(roc.s100b, partial.auc=c(100, 90), partial.auc.correct=TRUE, partial.auc.focus="sens")
ci.s100b <- ci(auc.s100b, boot.n=100, ci.alpha=0.9, stratified=FALSE)

plot(roc.s100b, grid=TRUE, show.thres = TRUE)
plot(auc.s100b, auc.polygon = TRUE, max.auc.polygon = TRUE, add = TRUE)
plot(ci.s100b, add = TRUE)

This will require some refactoring to add plot.auc and a plot.ci.auc; and probably several more for consistency.

In the long term, consider dropping the partial.auc arguments in ROC and have them only in auc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant