R/bootstrap.sample.R

Defines functions bootstrap.sample

bootstrap.sample <-
function(data, group, method = c("ncoutcome","coutcome")) {
	method <- match.arg(method)
	if(method == "coutcome") { 
		res <- do.call("rbind", lapply(split(data,data[,group]), function(x)x[sample(nrow(x), replace=TRUE),]))       
	} else {
		res <- data[sample(nrow(data), replace=TRUE),]
	}
	res
}

Try the AROC package in your browser

Any scripts or data that you put into this service are public.

AROC documentation built on March 18, 2022, 5:22 p.m.