File: optimal.cutpoints.formula.R

package info (click to toggle)
r-cran-optimalcutpoints 1.1-5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 432 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
optimal.cutpoints.formula <-
function(X, tag.healthy, methods, data, direction = c("<", ">"), categorical.cov = NULL, pop.prev = NULL, control = control.cutpoints(), ci.fit = FALSE, conf.level = 0.95, trace = FALSE, ...) {
	if(missing(X)) {
		stop("'X' argument required.", call.=FALSE)
	}
	marker <- all.vars(X)[attr(terms(X), "response")]
	status <- attr(terms(X), "term.labels")
	if(length(marker) != 1 | length(status) != 1) {
		stop("Invalid formula. Please correct", call.=FALSE)
	}
	res <- optimal.cutpoints.default(X = marker, status = status, tag.healthy = tag.healthy, methods = methods, data = data, direction = direction, categorical.cov = categorical.cov, pop.prev = pop.prev, control = control, ci.fit = ci.fit, conf.level = conf.level, trace = trace)
	res$call <- match.call()
	res
}