View source: R/plot_functions.R
| plot_mod.default | R Documentation | 
This function adds an estimated regression line to an existing probability plot (plot_prob).
## Default S3 method:
plot_mod(
  p_obj,
  x,
  dist_params,
  distribution = c("weibull", "lognormal", "loglogistic", "sev", "normal", "logistic",
    "weibull3", "lognormal3", "loglogistic3", "exponential", "exponential2"),
  title_trace = "Fit",
  ...
)
p_obj | 
 A plot object returned by plot_prob.  | 
x | 
 A numeric vector containing the x-coordinates of the respective regression line.  | 
dist_params | 
 A (named) numeric vector of estimated location and scale
parameters for a specified distribution. The order of elements is important.
First entry needs to be the location parameter   | 
distribution | 
 Supposed distribution of the random variable.  | 
title_trace | 
 A character string which is assigned to the legend trace.  | 
... | 
 Further arguments passed to or from other methods. Currently not used.  | 
A plot object containing the probability plot with plotting positions and the estimated regression line.
Meeker, William Q; Escobar, Luis A., Statistical methods for reliability data, New York: Wiley series in probability and statistics, 1998
plot_mod
# Vectors:
cycles <- alloy$cycles
status <- alloy$status
# Probability estimation
prob_tbl <- estimate_cdf(x = cycles, status = status, method = "johnson")
# Example 1: Probability Plot and Regression Line Three-Parameter-Weibull:
plot_weibull <- plot_prob(
  x = prob_tbl$x,
  y = prob_tbl$prob,
  status = prob_tbl$status,
  id = prob_tbl$id,
  distribution = "weibull"
)
rr <- rank_regression(
  x = prob_tbl$x,
  y = prob_tbl$prob,
  status = prob_tbl$status,
  distribution = "weibull3"
)
plot_reg_weibull <- plot_mod(
  p_obj = plot_weibull,
  x = prob_tbl$x,
  dist_params = rr$coefficients,
  distribution = "weibull3"
)
# Example 2: Probability Plot and Regression Line Three-Parameter-Lognormal:
plot_lognormal <- plot_prob(
  x = prob_tbl$x,
  y = prob_tbl$prob,
  status = prob_tbl$status,
  id = prob_tbl$id,
  distribution = "lognormal"
)
rr_ln <- rank_regression(
  x = prob_tbl$x,
  y = prob_tbl$prob,
  status = prob_tbl$status,
  distribution = "lognormal3"
)
plot_reg_lognormal <- plot_mod(
  p_obj = plot_lognormal,
  x = prob_tbl$x,
  dist_params = rr_ln$coefficients,
  distribution = "lognormal3"
)
## Mixture Identification
# Vectors:
hours <- voltage$hours
status <- voltage$status
# Probability estimation:
prob_mix <- estimate_cdf(
  x = hours,
  status = status,
  method = "johnson"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.