[Soft-deprecated]

dist_delay_register() is no longer under active development, switching to dist_delay is recommended.

dist_delay_register(date_prod, date_register, distribution = "lognormal")

Arguments

date_prod

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.

date_register

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.

distribution

Supposed distribution of the random variable. Only "lognormal"is implemented.

Value

A named vector of estimated parameters for the specified distribution.

Details

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.

Examples

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.