Nothing
plot.np.reg.test <-
function(x, alpha = 0.05, col = "grey", col.rr = "red",
col.stat = "black", lty.stat = 2, lwd.stat = 2,
xlab = "Test Statistic", main = "Permutation Distribution",
breaks = "scott", border = NA, box = TRUE, SQRT = TRUE, ...){
if(!is.null(x$perm.dist)){
# check "alpha"
alpha <- as.numeric(alpha[1])
if(alpha <= 0 | alpha >= 1) stop("Input 'alpha' must be between 0 and 1")
# check SQRT
if(SQRT){
x$perm.dist <- sqrt(x$perm.dist)
x$statistic <- sqrt(x$statistic)
}
# get breaks and midpoints
h <- suppressWarnings(hist(x$perm.dist, breaks = breaks, plot = FALSE, ...))
# define colors
cval <- quantile(x$perm.dist, probs = 1 - alpha)
hcol <- ifelse(h$mids >= cval, col.rr, col)
# plot perm.test
hist(x$perm.dist, breaks = breaks, col = hcol,
border = border, main = main, xlab = xlab, ...)
if(box) box()
# plot statistic
abline(v = x$statistic, lty = lty.stat, lwd = lwd.stat, col = col.stat)
} else {
warning("Plot unavailable because perm.dist is NULL\nSet perm.dist = TRUE when calling np.reg.test")
}
} # end plot.np.reg.test
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.