View source: R/delay_distributions.R
dist_delay_register | R Documentation |
dist_delay_register()
is no longer under active development, switching to
dist_delay is recommended.
dist_delay_register(date_prod, date_register, distribution = "lognormal")
date_prod |
A vector of class |
date_register |
A vector of class |
distribution |
Supposed distribution of the random variable. Only
|
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.
A named vector of estimated parameters for the specified distribution.
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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.