Description Usage Arguments Value Examples
This function is a wrapper that combines both, the
mcs_delay_register
and mcs_delay_report
function
for adjusting the operation times of censored units.
1 2 | mcs_delays(date_prod, date_register, date_repair, date_report, x, event,
distribution = "lognormal", details = FALSE, seed = NULL)
|
date_prod |
a vector of class |
date_register |
a vector of class |
date_repair |
a vector of class |
date_report |
a vector of class |
x |
a numeric vector of operating times. |
event |
a vector of binary data (0 or 1) indicating whether unit i is a right censored observation (= 0) or a failure (= 1). |
distribution |
supposed distribution of the random variable. The default
value is |
details |
a logical variable, where the default value is |
seed |
if |
A numerical vector of corrected operating times for the censored units
and the input operating times for the failed units if
details = FALSE
. If details = TRUE
the output is a list which
consists of the following elements:
time
: Numerical vector of corrected operating times for the
censored observations and input operating times for failed units.
x_sim_regist
: Simulated random numbers of specified
distribution with estimated parameters for delay in registration.
The length of x_sim_regist
is equal to the number of censored
observations.
x_sim_report
: Simulated random numbers of specified
distribution with estimated parameters for delay in report.
The length of x_sim_report
is equal to the number of censored
observations.
coefficients_regist
: Estimated coefficients of supposed
distribution for delay in registration.
coefficients_report
: Estimated coefficients of supposed
distribution for delay in report.
int_seed
: Integer seed number for reproducibility.
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 | date_of_production <- c("2014-07-28", "2014-02-17", "2014-07-14",
"2014-06-26", "2014-03-10", "2014-05-14",
"2014-05-06", "2014-03-07", "2014-03-09",
"2014-04-13", "2014-05-20", "2014-07-07",
"2014-01-27", "2014-01-30", "2014-03-17",
"2014-02-09", "2014-04-14", "2014-04-20",
"2014-03-13", "2014-02-23", "2014-04-03",
"2014-01-08", "2014-01-08")
date_of_registration <- c("2014-08-17", "2014-03-29", "2014-12-06",
"2014-09-09", "2014-05-14", "2014-07-01",
"2014-06-16", "2014-04-03", "2014-05-23",
"2014-05-09", "2014-05-31", "2014-08-12",
"2014-04-13", "2014-02-15", "2014-07-07",
"2014-03-12", "2014-05-27", "2014-06-02",
"2014-05-20", "2014-03-21", "2014-06-19",
"2014-02-12", "2014-03-27")
date_of_repair <- c(NA, "2014-09-15", "2015-07-04", "2015-04-10", NA,
NA, "2015-04-24", NA, "2015-04-25", "2015-04-24",
"2015-06-12", NA, "2015-05-04", NA, NA,
"2015-05-22", NA, "2015-09-17", NA, "2015-08-15",
"2015-11-26", NA, NA)
date_of_report <- c(NA, "2014-10-09", "2015-08-28", "2015-04-15", NA,
NA, "2015-05-16", NA, "2015-05-28", "2015-05-15",
"2015-07-11", NA, "2015-08-14", NA, NA,
"2015-06-05", NA, "2015-10-17", NA, "2015-08-21",
"2015-12-02", NA, NA)
op_time <- rep(1000, length(date_of_repair))
state <- c(0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0)
# Example 1 - Simplified vector output:
x_corrected <- mcs_delays(date_prod = date_of_production,
date_register = date_of_registration,
date_repair = date_of_repair,
date_report = date_of_report,
x = op_time,
event = state,
distribution = "lognormal",
seed = NULL,
details = FALSE)
# Example 2 - Detailed list output:
list_detail <- mcs_delays(date_prod = date_of_production,
date_register = date_of_registration,
date_repair = date_of_repair,
date_report = date_of_report,
x = op_time,
event = state,
distribution = "lognormal",
seed = NULL,
details = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.