qMO <-
function(p, theta=1, lower.tail = TRUE, log.p = FALSE)
{
if(theta<0) stop("theta must be less than 0")
Qy<-log(p)-log(p+theta*(1-p))
Qy <- ifelse(p <= 0, -Inf, Qy)
Qy <- ifelse(p >= 1, Inf, Qy)
if(log.p == FALSE) Qy <- exp(Qy)
if(lower.tail==FALSE) Qy<-1-Qy
Qy
}
