R/plot_functions.R
plot_prob.default.Rd
This function is used to apply the graphical technique of probability plotting.
# S3 method for default
plot_prob(
x,
y,
status,
id = rep("XXXXXX", length(x)),
distribution = c("weibull", "lognormal", "loglogistic", "sev", "normal", "logistic",
"exponential"),
title_main = "Probability Plot",
title_x = "Characteristic",
title_y = "Unreliability",
title_trace = "Sample",
plot_method = c("plotly", "ggplot2"),
...
)
A numeric vector which consists of lifetime data. Lifetime data could be every characteristic influencing the reliability of a product, e.g. operating time (days/months in service), mileage (km, miles), load cycles.
A numeric vector which consists of estimated failure probabilities
regarding the lifetime data in x
.
A vector of binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1).
Identification for every unit.
Supposed distribution of the random variable.
A character string which is assigned to the main title.
A character string which is assigned to the title of the x axis.
A character string which is assigned to the title of the y axis.
A character string which is assigned to the legend trace.
Package, which is used for generating the plot output.
Further arguments passed to or from other methods. Currently not used.
A plot object containing the probability plot.
For plot_method == "plotly"
the marker label for x and y are determined by
the first word provided in the argument title_x
and title_y
respectively,
i.e. if title_x = "Mileage in km"
the x label of the marker is "Mileage".
Meeker, William Q; Escobar, Luis A., Statistical methods for reliability data, New York: Wiley series in probability and statistics, 1998
# Vectors:
cycles <- alloy$cycles
status <- alloy$status
# Probability estimation:
prob_tbl <- estimate_cdf(
x = cycles,
status = status,
method = "johnson"
)
# Example 1: Probability Plot Weibull:
plot_weibull <- plot_prob(
x = prob_tbl$x,
y = prob_tbl$prob,
status = prob_tbl$status,
id = prob_tbl$id
)
# Example 2: Probability Plot Lognormal:
plot_lognormal <- plot_prob(
x = prob_tbl$x,
y = prob_tbl$prob,
status = prob_tbl$status,
id = prob_tbl$id,
distribution = "lognormal"
)