R/plot_functions.R
plot_mod_mix.Rd
plot_mod_mix()
is no longer under active development, switching to
plot_mod is recommended.
plot_mod_mix(
p_obj,
x,
status,
mix_output,
distribution = c("weibull", "lognormal", "loglogistic"),
title_trace = "Fit",
...
)
A plot object returned by plot_prob_mix.
A numeric vector containing the x-coordinates of the respective regression line.
A vector of binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1).
A list returned by mixmod_regression or mixmod_em, which consists of elements necessary to visualize the regression lines.
Supposed distribution of the random variable.
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 estimated regression line(s).
This function adds one or multiple estimated regression lines to an existing probability plot plot_prob). Depending on the output of the function mixmod_regression or mixmod_em one or multiple lines are plotted.
The name of the legend entry is a combination of the title_trace
and the
number of determined subgroups. If title_trace = "Line"
and the data has
been split in two groups, the legend entries would be "Line: 1"
and
"Line: 2"
.
Doganaksoy, N.; Hahn, G.; Meeker, W. Q., Reliability Analysis by Failure Mode, Quality Progress, 35(6), 47-52, 2002
# Vectors:
hours <- voltage$hours
status <- voltage$status
# Example 1 - Using result of mixmod_em in mix_output:
mix_mod_em <- mixmod_em(
x = hours,
status = status,
distribution = "weibull",
conf_level = 0.95,
k = 2,
method = "EM",
n_iter = 150
)
plot_weibull_em <- plot_prob_mix(
x = hours,
status = status,
id = id,
distribution = "weibull",
mix_output = mix_mod_em
)
#> Warning: `plot_prob_mix()` was deprecated in weibulltools 2.0.0.
#> Please use `plot_prob()` instead.
plot_weibull_emlines <- plot_mod_mix(
p_obj = plot_weibull_em,
x = hours,
status = status,
mix_output = mix_mod_em,
distribution = "weibull"
)
#> Warning: `plot_mod_mix()` was deprecated in weibulltools 2.0.0.
#> Please use `plot_mod()` instead.
# Example 2 - Using result of mixmod_regression in mix_output:
john <- johnson_method(x = hours, status = status)
#> Warning: `johnson_method()` was deprecated in weibulltools 2.0.0.
#> Please use `estimate_cdf()` instead.
mix_mod_reg <- mixmod_regression(
x = john$x,
y = john$prob,
status = john$status,
distribution = "weibull"
)
plot_weibull_reg <- plot_prob_mix(
x = john$x,
status = john$status,
id = john$id,
distribution = "weibull",
mix_output = mix_mod_reg,
)
#> Warning: `plot_prob_mix()` was deprecated in weibulltools 2.0.0.
#> Please use `plot_prob()` instead.
plot_weibull_reglines <- plot_mod_mix(
p_obj = plot_weibull_reg,
x = john$x,
status = john$status,
mix_output = mix_mod_reg,
distribution = "weibull"
)
#> Warning: `plot_mod_mix()` was deprecated in weibulltools 2.0.0.
#> Please use `plot_mod()` instead.