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 ROCnReg package in your browser

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

ROCnReg documentation built on March 31, 2023, 5:42 p.m.