testmz {npcure} | R Documentation |
This function carries out the nonparametric test of Maller and Zhou (1992).
testmz(t, d, dataset)
t |
If |
d |
If |
dataset |
An optional data frame in which the variables named in
|
The function implements Maller and Zhou's (1992) method to
test the null hypothesis H_{0} : \tau_{F_{0}} > \tau_{G}
vs. H_{1} : \tau_{F_{0}} \leq \tau_{G}
, where \tau_{F_{0}}
and
\tau_{G}
are the supports of, respectively, the
distribution function of the survival time of the uncured and the
distribution function of the censoring time.
An object of S3 class 'npcure'. Formally, a list of components:
type |
The constant character string c("test", "Maller-Zhou"). |
pvalue |
The p-value of the test. |
aux |
A list of components: |
Ignacio López-de-Ullibarri [aut, cre], Ana López-Cheda [aut], Maria Amalia Jácome [aut]
Maller R. A., Zhou S. (1992). Estimating the proportion of immunes in a censored sample. Biometrika, 79: 731-739. https://doi.org/10.1093/biomet/79.4.731.
## Some artificial data
set.seed(123)
n <- 50
y <- qweibull(runif(n)*pweibull(2, shape = 2), shape = 2) ## True lifetimes
c <- qexp(runif(n)*pexp(2.5)) ## Censoring values
u <- runif(n)
## Probability of being susceptible is constantly equal to .5
t <- ifelse(u < .5, pmin(y, c), c) ## Observed times
d <- ifelse(u < .5, ifelse(y < c, 1, 0), 0) ## Uncensoring indicator
data <- data.frame(t = t, d = d)
## Maller-Zhou test
testmz(t, d, data)