#'
y0Vector <- c(5, 4, 3, 3, 2, 1)
y1Vector <- c(5, 5, 4, 2, 2, 0)
obs0Vector <- c(1, 1, 0, 1, 0, 1)
obs1Vector <- c(0, 0, 1, 0, 1, 0)
logEValueGreater <- logEValueLess <- vector("numeric", length(y0Vector))
for (i in seq_along(y0Vector)) {
tempResult <- logrankSingleEExact(obs0=obs0Vector[i], obs1=obs1Vector[i],
y0=y0Vector[i], y1=y1Vector[i],
thetaS=0.7, theta0=1)
logEValueLess[i] <- tempResult[["logEValueLess"]]
logEValueGreater[i] <- tempResult[["logEValueGreater"]]
}
eValueLess <- exp(sum(logEValueLess))
eValueLess #1.116161
eValueGreater <- exp(sum(logEValueGreater))
eValueGreater # 0.7665818
eValue <- 1/2*eValueLess + 1/2*eValueGreater
eValue # 0.9413714
Run the code above in your browser using DataLab