my current code for dnbinom.c has prob = dbinom_raw(n,x+n,p,1-p,give_log); f = ((double)n)/((double)(n+x)); return((give_log) ? log(f) + prob : f*prob); which should work for x>=0, n>=0, 0<=p<=1. dbinom.raw(x,n,p) is intended to work for x>=0, n>=0, 0<=p<=1, without integer checks. When necessary (ie. for x in the dnbinom case) the checks should be done in the calling function. --Catherine. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._