1 year ago
#180015
Matheus assi
Using weibulltools package in R to calculate distribution functions, hazard plots and reliability plots
I'm using weibulltools package in R to estimate the life of a product. I would like to know if it is possible to add more functions like creating probability density plots, hazard plots, reliability plot (which is 1- unreliability). As far as I know, the weibulltolls only calculates the unreliability plots. How to do that?
Here it is an example on how to plot unreliability graph
library(weibulltools)
library(readxl)
data3 <- data3 <- structure(list(id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72), cycles = c(300,
300, 300, 300, 300, 291, 274, 271, 269, 257, 256, 227, 226, 224,
213, 211, 205, 203, 197, 196, 190, 189, 188, 187, 184, 180, 180,
177, 176, 173, 172, 171, 170, 170, 169, 168, 168, 162, 159, 159,
159, 159, 152, 152, 149, 149, 144, 143, 141, 141, 140, 139, 139,
136, 135, 133, 131, 129, 123, 121, 121, 118, 117, 117, 114, 112,
108, 104, 99, 99, 96, 94), status = c(0, 0, 0, 0, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-72L))
View(data3)
rel_tbl <- reliability_data(
data = data3,
x = "cycles",
status = "status",
id = NULL
)
cdf_tbl <- estimate_cdf(
x = rel_tbl,
methods = "johnson", # choose beteen jhonson, kaplan, nelson, mr method
options = list()
)
p_prob <- plot_prob(
x = cdf_tbl,
distribution = "weibull", # type any distribution
title_main = "Probability Plot",
title_x = "Characteristic",
title_y = "Unreliability",
title_trace = "Sample",
plot_method = "plotly"
)
rr <- rank_regression(
x = cdf_tbl,
distribution = "weibull", # type any distribution
conf_level = 0.95,
direction = "x_on_y",
control = list(),
options = list(conf_method = "HC")
)
rr
conf_bb <- confint_betabinom(rr,
b_lives = c(
0.01,
0.1,
0.5
),
bounds = "two_sided",
conf_level = 0.95,
direction = "y"
)
p_conf <- plot_conf(
p_obj = p_prob,
x = conf_bb,
title_trace_mod = "Fit",
title_trace_conf = "Confidence Limit"
)
p_conf
View(conf_bb)
here it is the data structure
id cycles status
1 300 0
2 300 0
3 300 0
4 300 0
5 300 0
6 291 1
7 274 1
8 271 1
9 269 1
10 257 1
11 256 1
12 227 1
13 226 1
14 224 1
15 213 1
16 211 1
17 205 1
18 203 1
19 197 1
20 196 1
21 190 1
22 189 1
23 188 1
24 187 1
25 184 1
26 180 1
27 180 1
28 177 1
29 176 1
30 173 1
31 172 1
32 171 1
33 170 1
34 170 1
35 169 1
36 168 1
37 168 1
38 162 1
39 159 1
40 159 1
41 159 1
42 159 1
43 152 1
44 152 1
45 149 1
46 149 1
47 144 1
48 143 1
49 141 1
50 141 1
51 140 1
52 139 1
53 139 1
54 136 1
55 135 1
56 133 1
57 131 1
58 129 1
59 123 1
60 121 1
61 121 1
62 118 1
63 117 1
64 117 1
65 114 1
66 112 1
67 108 1
68 104 1
69 99 1
70 99 1
71 96 1
72 94 1
r
distribution
reliability
weibull
0 Answers
Your Answer