Use empirical likelihood ratio and Wilks theorem to test the null hypothesis that $$\int f(t) dH(t) = \theta $$ with right censored, left truncated data. Where \(H(t)\) is the unknown cumulative hazard function; \(f(t)\) can be any given function and \(\theta\) a given constant. In fact, \(f(t)\) can even be data dependent, just have to be `predictable'.
emplikH1.test(x, d, y= -Inf, theta, fun, tola=.Machine$double.eps^.5)
A list with the following components:
the location of the hazard jumps.
the jump size of hazard function at those locations.
the Lagrange multiplier.
the -2Log Likelihood ratio.
P-value
number of iterations used
a vector of the censored survival times.
a vector of the censoring indicators, 1-uncensor; 0-censor.
a vector of the observed left truncation times.
a real number used in the \(H_0\) to set the hazard to this value.
a left continuous (weight) function used to calculate
the weighted hazard in \( H_0\). fun
must be able
to take a vector input. See example below.
an optional positive real number specifying the tolerance of iteration error in solve the non-linear equation needed in constrained maximization.
Mai Zhou
This function is designed for the case where the true distributions are all continuous. So there should be no tie in the data.
The log empirical likelihood used here is the `Poisson' version empirical likelihood: $$ \sum_{i=1}^n \delta_i \log (dH(x_i)) - [ H(x_i) - H(y_i) ] ~. $$
If there are ties in the data that are resulted from rounding,
you may break the tie by adding a different tiny number to the tied
observation(s). If those are true ties
(thus the true distribution is discrete)
we recommend use emplikdisc.test()
.
The constant theta
must be inside the so called
feasible region for the computation to continue. This is similar to the
requirement that in testing the value of the mean, the value must be
inside the convex hull of the observations.
It is always true that the NPMLE values are feasible. So when the
computation complains that there is no hazard function satisfy
the constraint, you should try to move the theta
value closer
to the NPMLE. When the computation stops prematurely,
the -2LLR should have value infinite.
Pan, X. and Zhou, M. (2002), ``Empirical likelihood in terms of hazard for censored data''. Journal of Multivariate Analysis 80, 166-188.
fun <- function(x) { as.numeric(x <= 6.5) }
emplikH1.test( x=c(1,2,3,4,5), d=c(1,1,0,1,1), theta=2, fun=fun)
fun2 <- function(x) {exp(-x)}
emplikH1.test( x=c(1,2,3,4,5), d=c(1,1,0,1,1), theta=0.2, fun=fun2)
Run the code above in your browser using DataLab