R/pgbinom.R

Defines functions pgbinom

Documented in pgbinom

pgbinom <-
function(q,size,prob,lower.tail = TRUE,log.p=FALSE){
q<-as.matrix(q)
z=apply(q,1,function(q) sum(dgbinom(c(0:q),size,prob)))
if (lower.tail == TRUE) 
	{pgb<-z}
else if (lower.tail == FALSE)
	{pgb<-1-z}
if (log.p==TRUE){
	pgb<-log(pgb)}
pgb
}

Try the GenBinomApps package in your browser

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

GenBinomApps documentation built on June 21, 2022, 5:07 p.m.