This function performs a Duane analysis (1962) doi:10.1109/TA.1964.4319640 on the provided failure data.
Usage
duane_plot(
times,
failures,
plot = TRUE,
log = TRUE,
point_col = "black",
line_col = "black",
xlab = "Cumulative Time",
ylab = "Cumulative MTBF",
main = "Duane Plot with Cumulative MTBF"
)
Arguments
- times
A vector of cumulative times at which failures occurred.
- failures
A vector of the number of failures at each corresponding time in times.
- plot
Show Duane plot (TRUE) or hide plot (FALSE).
- log
Logical indicating whether to use logarithmic scale for the plot (default: TRUE).
- point_col
Color for the data points (default: "black").
- line_col
Color for the fitted line (default: "black").
- xlab
Label for the x-axis (default: "Cumulative Time").
- ylab
Label for the y-axis (default: "Cumulative MTBF").
- main
Title for the plot (default: "Duane Plot with Cumulative MTBF").
Examples
times <- c(100, 200, 300, 400, 500)
failures <- c(1, 2, 1, 3, 2)
fit <- duane_plot(times, failures)
print(fit)
#> Duane Analysis Result
#> ----------------------
#> Linear model (log-log scale): log(MTBF) ~ log(Time)
#>
#> Coefficients:
#> (Intercept) log_cum_time
#> 3.6144974 0.2013244
#>
#> AIC: -3.55, BIC: -4.72