pcgen {pcensmix} | R Documentation |
Creating a Progressively Type-II Censored Version of a Given Dataset
Description
This function implements an algorithm for generating a progressive Type-II censored version of a specified dataset.
Usage
pcgen(r, p, data)
Arguments
r |
desired number of failures to observe. |
p |
a parameter controlling the amount of censoring. The action of
censoring individuals after each failure occurs with probabilty |
data |
a numeric vector of a real dataset (mixture/not mixture) or an
object of class |
Details
It creates a progressive Type-II censored version of a given real
dataset or a simulated dataset from mixgen
. The
output of this function can be passed as an argument to
pcensmixR
or pcensmixSim
for the purpose of fitting a
normal mixture model to the progressively censored dataset.
Value
An object of class "pcgen"
containing the following
information:
original_data |
original mixture data |
label |
component membership indicator for the original simulated mixture data. This will not be returned if a real data has been used. |
censored_version_of_data |
progressive Type-II censored version of data, i.e., each observation is equal to the actual observed survival time in the event of failure and is equal to the latest observe failure time if it is associated to an unobserved censored observation. Notice that they are order statistics. |
component_indicator |
component indicator associated with the censored_verison_of_data. This will not be returned if a real data has been used. |
censoring_indicator |
censoring indicator associated with the censored_verison_of_data. |
Note
See print.pcgen
for printing data of class
"pcgen"
.
Author(s)
Lida Fallah, John Hinde
Maintainer: Lida Fallah <l.fallah22@gmail.com>
See Also
Examples
## 1. Generate a progressive Type-II censored data from a simulated mixture data with
## allowing for censoring with controlling parameters p = 0.3 and r = 12.
set.seed(0)
mixture <- mixgen(N = 20, dist1 = 'norm', dist2 = 'weibull', control = list(12, 2, 15, 4, 0.3))
Pdat0 <- pcgen(r = 12, p = 0.3, data = mixture)
print(Pdat0)
## 2. Examples of generating a progresively Type-II censored data
set.seed(0)
Pdat1 <- pcgen(r = 6, p = 0.3, data = insulate)
print(Pdat1)
set.seed(100)
Pdat2 <- pcgen(r = 260, p = 0.35, data = blood$Systolic.BP)
print(Pdat2)