Description Usage Arguments Details See Also Examples
This Function creates the relative frequency plots of a box defined by define_fixbox
.
1 |
fixbox |
object of class " |
plot_together |
logical. If |
... |
further arguments of the functions |
Relative frequency plots are a diagnostic tool for a result of PRIM (fixbox
).
These are histograms or barplots illustrating ratios of distributions r_{jk} for each variable x_j.
This ratio is defined by the distribution of x_j in one box B_k divided by the distribution of this variable over the whole data set.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # generating random data:
set.seed(123)
n <- 500
x1 <- runif(n = n, min = -1)
x2 <- runif(n = n, min = -1)
x3 <- runif(n = n, min = -1)
cat <- as.factor(sample(c("a","b","c", "d"), size = n, replace = TRUE))
wsk <- (1-sqrt(x1^2+x2^2)/sqrt(2))
y <- as.logical(rbinom(n = n, prob = wsk, size = 1))
dat <- cbind.data.frame(y, x1, x2, x3, cat)
plot(dat$x1, dat$x2, col=dat$y+1, pch=16)
remove(x1, x2, x3, y, wsk, cat, n)
# apply the PRIM function to find the best box with a support of at least 0.1:
p <- PRIM(y~., data=dat, beta_min = 0.1, max_boxes = 1, print_position = FALSE)
# relative frequency plots:
relfreq(p$fixboxes[[1]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.