# Confidence interval for success probability in negative binomial experiment

Suppose I have a biased coin (heads with probability p), and I keep flipping it until I get t tails. So I had to flip n times in total to get t tails. How do I find a (frequentist) confidence interval for the probability of heads p?

-
First hit when Googling "negative binomial confidence interval": bepress.com/ucbbiostat/paper242 (abstract only). The seventh hit gets you a full paper along with its references to the literature: plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0000180 . –  whuber Jan 10 '11 at 2:51
I downvoted the question because it's eminently google-able. –  fabians Jan 10 '11 at 13:20
If you are looking for ML estimation (which may or may not be what you want) please check the fitdistr function in the MASSlibrary in R. This function can estimate the unknown parameters using ML estimation. But please be careful about the parametrization of the negative binomial distribution of MASS. Apart from estimating the unknown parameters, it gives the confidence intervals for the estimates.