make_right_censored_data(data, threshold=None, fraction_censored=None, seed=None)¶
This function is used to create right censored data from complete data. It will right censor the data based on a specified threshold or fraction to censor.
- data (list, array) – The complete data.
- threshold (int, float, optional) – This is the point to right censor (right censoring is done if data > threshold). This is known as “singly censored data” as everything is censored at a single point. Default is None in which case the fraction_censored will be used. See the notes below.
- fraction_censored (int, float, optional) – Must be >= 0 and < 1. Default = 0.5. Censoring is done randomly. This is known as “multiply censored data” as there are multiple times at which censoring occurs. See the notes below.
- seed (int, optional) – Sets the random seed. This is used for multiply censored data (i.e. when threshold is None). The data is shuffled to remove censoring bias that may be caused by any pre-sorting. Specifying the seed ensures a repeatable random shuffle. Default is None which will result in a different censoring each time. The seed is only used when threshold is not specified and the data is being multiply censored based on the fraction_censored.
- failures (array) – The array of failure data
- right_censored (array) – The array of right censored data
If both threshold and fraction_censored are None, fraction_censored will default to 0.5 to produce multiply censored data. If both threshold and fraction_censored are specified, an error will be raised since these methods conflict.