Compute the binomial empirical likelihood ratio for the given tilt parameter lambda. Most useful for construct Wilks confidence intervals. The null hypothesis or constraint is defined by the parameter \(\theta\), where $$ \int fun1(t) d \log(1-H_1(t)) - \int fun2(t) d \log (1-H_2(t)) = \theta $$
If the lambda=0, you get the Nelson-Aalen (NPMLE) and output -2LLR =0. Otherwise the lambda is not scaled (as in one sample case). Since there are two sample sizes. It can be confusing which sample size to use for scale. So the lambda here is larger than those in one sample by a sclae of (either?) sample size.
Where \(H_1(t)\) and \(H_2(t)\) are the unknown cumulative hazard function for sample 1/2; \(fun1(t)\) and \(fun2(t)\) can be any given function. It can even be random, just need to be predictable. In the future, the input function \(fun\) may replaced by the vector of \(fun(x)\), since this is more flexible.
Input data can be right censored. If no censoring, set d1=rep(1, length(x1))
, and/or d2=rep(1, length(x2))
.
emplikH2B(lambda, x1, d1, x2, d2, fun1, fun2, CIforTheta=FALSE)
A list with the following components:
the -2Log Empirical Likelihood ratio, binomial version.
the input lambda. The tilt. The Lagrange multiplier.
the location of the hazard jumps. sample 1.
the location of the hazard jumps. sample 2.
the jump size of hazard function at those locations.
the jump size of hazard function at those locations.
Difference of two hazard integrals. theta defined above.
a scalar. Can be positive or negative. The amount of tiling.
a vector of the censored survival times. sample 1
a vector of the censoring indicators, 1-uncensor; 0-right censor.
a vector of the censored survival times. sample 2
a vector of the censoring indicators, 1-uncensor; 0-right censor.
a left continuous (weight) function used to calculate
the weighted hazard in the parameter \(\theta\). fun1
must be able
to take a vector input. See example below.
Ditto
an optional logical value. Default to FALSE. If set to TRUE, will return the integrated hazard value for the given lambda.
Mai Zhou
This function is used to calculate lambda confidence interval (Wilks type) for \(\theta\).
This function is designed for the case where the true distribution should be discrete. Ties in the data are OK.
The log empirical likelihood used here is the `binomial' version empirical likelihood: $$ \log EL1 = \sum_{i=1}^n \delta_i \log (dH(x_i)) + (R_i - \delta_i)\log [1- dH(x_i) ] ~, $$ (similarly defined for sample 2) and the overall log EL = log EL1 + log EL2.
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