View source: R/plotly_npmvtol.R
plotly_npmvtol | R Documentation |
plotly_npmvtol
is plotting function for nonparametric multivaraite hyperrectangular tolerance region. The function takes the outcome of npmvtol.region
as an input and provides visualzation for hypperrectangular tolerance regions between two variables.
plotly_npmvtol(tol.out,
x,
var.names = NULL,
title = NULL,
x.col = "#4298B5",
x.cex = 6,
x.shape = "dot",
outlier.col = "#A6192E",
outlier.cex = 8,
outlier.shape = "triangle-up",
tol.col = "#D1DDE6",
tol.opacity = 0.4,
x.lab.size = 12,
x.tick.size = 12,
y.lab.size = 12,
y.tick.size = 12,
title.position.x = 0.5,
title.position.y = 0.98,
title.size = 12,
show.bound = TRUE,
bound.type = c("dash", "dot", "solid", "longdash",
"dashdot", "longdashdot"),
bound.col = "#000000",
bound.lwd = 1
)
tol.out |
Output from |
x |
Data frame for different variables. Columns of |
var.names |
Labels of variable names. The dimension of |
title |
The main title on top of the plot. The length of |
x.col |
Color of original data points, excluding outliers. |
x.cex |
Size of original data points, excluding outliers. |
x.shape |
Shape of original data points, excluding outliers. |
outlier.col |
Color of outliers. |
outlier.cex |
Size of outliers. |
outlier.shape |
Shape of outliers. |
tol.col |
Color of tolerance region. |
tol.opacity |
Opacity of tolerance region. |
x.lab.size |
Size of label of the x-axis. |
x.tick.size |
Size of tick marks on the x-axis. |
y.lab.size |
Size of label of the y-axis. |
y.tick.size |
Size of tick marks on the y-axis. |
title.position.x |
Horizontal position of the title. |
title.position.y |
Vertical position of the title. |
title.size |
Size of the title. |
show.bound |
Logical indicating to show rectanglular boundaries. Default is |
bound.type |
Line type of the rectangle boundaries. |
bound.col |
Color of the rectangle boundaries. |
bound.lwd |
Width of the rectangle boundaries. |
plotly_npmvtol
returns figures of hypperectangular tolerance regions between two random variable generated by npmvtol.region
.
Young, D. S., & Mathew, T. (2020), Nonparametric Hyperrectangular Tolerance and Prediction Regions for Setting Multivariate Reference Regions in Laboratory Medicine. Statistical Methods in Medical Research, 29, 3569–3585.
npmvtol.region
library(plotly)
mdepth <- function(pts, x){
mahalanobis(pts, center = rep(0, 3),
cov = diag(1, 3))
}
set.seed(100)
x <- cbind(X1=rnorm(300), X2=rnorm(300), X3=rnorm(300))
out <-npmvtol.region(x = x, alpha = 0.10, P = 0.90, depth.fn = mdepth,
type = "semispace", semi.order = list(lower = 2,
center = 3, upper = 1))
gg.out <- plotly_npmvtol(tol.out = out , x = x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.