| plot_weights.fujikawa_x | R Documentation |
This function is a wrapper of baskexact::plot_weights(). It visualizes
the weight functions defined for Fujikawa et al.'s design.
## S3 method for class 'fujikawa_x'
plot_weights(
design,
n,
r1,
weight_fun = weights_jsd,
weight_params = list(),
...
)
design |
An object created with one of the |
n |
The sample size per basket. |
r1 |
Number of responses in one basket |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
... |
Further arguments. |
A ggplot object, showing the range of responses in the "other"
basket on the x-axis and the corresponding weight on the y-axis.
design <- setup_fujikawa_x(k = 3, p0 = 0.2, backend = "exact")
# Default weight function is weights_jsd, which is identical
# to the Jensen-Shannon weights
plot_weights(design = design, n = 20, r1 = 11,
weight_params = list(tau = 0, epsilon = c(0.25, 0.5, 1, 2),
logbase = 2))
# Explicitly compare Jensen-Shannon and Hellinger weights
plot_weights(design = design, n = 20, r1 = 11,
weight_fun = baskexact::weights_fujikawa,
weight_params = list(tau = 0, epsilon = c(0.25, 0.5, 1, 2),
logbase = 2))
plot_weights(design = design, n = 20, r1 = 11, weight_fun = weights_hld,
weight_params = list(tau = 0, epsilon = c(0.25, 0.5, 1, 2),
logbase = 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.