R/delay_distributions.R
dist_delay_register.Rd
dist_delay_register()
is no longer under active development, switching to
dist_delay is recommended.
dist_delay_register(date_prod, date_register, distribution = "lognormal")
A vector of class character
or Date
, in the
format "yyyy-mm-dd", indicating the date of production of a unit.
Use NA
for missing elements.
A vector of class character
or Date
, in
the format "yyyy-mm-dd", indicating the date of registration of a unit.
Use NA
for missing elements.
Supposed distribution of the random variable. Only
"lognormal"
is implemented.
A named vector of estimated parameters for the specified distribution.
This function introduces a delay random variable by calculating the time difference between the registration and production date for the sample units and afterwards estimates the parameter(s) of a supposed distribution, using maximum likelihood.
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(NA, "2014-03-29", "2014-12-06", "2014-09-09",
NA, NA, "2014-06-16", NA, "2014-05-23",
"2014-05-09", "2014-05-31", NA, "2014-04-13",
NA, NA, "2014-03-12", NA, "2014-06-02",
NA, "2014-03-21", "2014-06-19", NA, NA)
params_delay_regist <- dist_delay_register(
date_prod = date_of_production,
date_register = date_of_registration,
distribution = "lognormal"
)
#> Warning: `dist_delay_register()` was deprecated in weibulltools 2.0.0.
#> Please use `dist_delay()` instead.