R/pCFNB.R

#' @export
pCFNB<-function (x, a, b, s, lambda , log.p = FALSE, lower.tail = TRUE)
	{
	G=(1-((1+(x/a)^b))^(-1))
	cdf <- x
    cdf[log.p == FALSE & lower.tail == TRUE] <-(((1-lambda*G)^(-s))-1)/(((1-lambda)^(-s))-1)
	cdf[log.p == TRUE & lower.tail == TRUE] <-log(((1-lambda*G)^(-s))-1)-log(((1-lambda)^(-s))-1)
    cdf[log.p == FALSE & lower.tail == FALSE] <-(((1-lambda)^(-s))-((1-lambda*G)^(-s)))/((1-lambda)^(-s)-1)
    cdf[log.p == TRUE & lower.tail == FALSE] <--s*log(1-lambda)+s*log(1-lambda*G)-log((1-lambda)^(-s)-1)
    return(cdf)
	}

Try the ComRiskModel package in your browser

Any scripts or data that you put into this service are public.

ComRiskModel documentation built on May 31, 2023, 8:17 p.m.