goft {MDCcure} | R Documentation |
Goodness-of-fit tests for the cure rate in a mixture cure model
Description
The aim of this function is to test whether the cure rate p
, as a function of the covariates, satisfies a certain parametric model.
Usage
goft(
x,
time,
delta,
model = c("logit", "probit", "cloglog"),
theta0 = NULL,
nsimb = 499,
h = NULL
)
Arguments
x |
A numeric vector representing the covariate of interest. |
time |
A numeric vector of observed survival times. |
delta |
A numeric vector indicating censoring status (1 = event occurred, 0 = censored). |
model |
A character string specifying the parametric model for the incidence part. Can be |
theta0 |
Optional numeric vector with initial values for the model parameters. Default is |
nsimb |
An integer indicating the number of bootstrap replicates.Default is |
h |
Optional bandwidth value used for nonparametric estimation of the cure rate. Default is |
Details
We want to test wether the cure rate p
, as a function of covariates, satisfies a certain parametric model, such as, logistic, probit or cloglog model.
The hypothesis are:
\mathcal{H}_0 : p = p_{\theta} \quad \text{for some} \quad \theta \in \Theta
\quad \text{vs} \quad
\mathcal{H}_1 : p \neq p_{\theta} \quad \text{for all} \quad \theta \in \Theta,
where \Theta
is a finite-dimensional parameter space and p_{\theta}
is a known function up to the parameter vector \theta
.
The test statistic is based on a weighted L_2
distance between a nonparametric estimator \hat{p}(x)
and a parametric estimator p_{\hat{\theta}}(x)
under \mathcal{H}_0
,
as proposed by Müller and Van Keilegom (2019):
\mathcal{T}_n = n h^{1/2} \int \left(\hat{p}(x) - p_{\hat{\theta}}(x)\right)^2 \pi(x) dx,
where \pi(x)
is a known weighting function, often chosen as the covariate density f(x)
.
A practical empirical version of the statistic is given by:
\tilde{\mathcal{T}}_n = n h^{1/2} \frac{1}{n} \sum_{i = 1}^n \left(\hat{p}(x_i) - p_{\hat{\theta}}(x_i)\right)^2,
where the integral is replaced by a sample average.
Value
A list with the following components:
- statistic
Numeric value of the test statistic.
- p.value
Numeric value of the bootstrap p-value for testing the null hypothesis.
- bandwidth
The bandwidth used.
References
Müller, U.U, & Van Keilegom, I. (2019). Goodness-of-fit tests for the cure rate in a mixture cure model. Biometrika, 106, 211-227. doi:10.1093/biomet/asy058
Examples
## Some artificial data
set.seed(123)
n <- 50
x <- runif(n, -2, 2) ## Covariate values
y <- rweibull(n, shape = .5*(x + 4)) ## True lifetimes
c <- rexp(n) ## Censoring values
p <- exp(2*x)/(1 + exp(2*x)) ## Probability of being susceptible
u <- runif(n)
t <- ifelse(u < p, pmin(y, c), c) ## Observed times
d <- ifelse(u < p, ifelse(y < c, 1, 0), 0) ## Uncensoring indicator
data <- data.frame(x = x, t = t, d = d)
goft(x, t, d, model = "logit")