3

How do I solve for the "prob=" parameter of pbinom() if I want pbinom() to equal a specific value and I assume values for "q=" and "size=" parameters? Let's assume that I want pbinom() to equal 0.1 when I have q=5, size=10, and lower.tail=FALSE, is there a function or way to determine to what the "prob=" parameter should be equal? For example:

> pbinom(q=5,size=10,prob=.3542,lower.tail=FALSE)
[1] 0.09998054

Through trial and error, I found that prob=.3542 is close enough. I know that qbinom() is the inverse of pbinom(), but I'm not interested in finding q=5 given I want pbinom()=.1. I instead want to find "prob=" given I know pbinom(q=5,size=10,prob=?,lower.tail=FALSE)=.1. Thanks in advance for your help.

*Sorry if this has already been answered elsewhere. I looked and couldn't find it. Seems pretty simple, so I was surprised.

Metrics
  • 14,056
  • 6
  • 47
  • 78
Ursus Frost
  • 265
  • 5
  • 13
  • 2
    This is essentially the same problem as answered here: [non-central chi-square probability and non-centrality parameter](http://stackoverflow.com/questions/18394018/non-central-chi-square-probability-and-non-centrality-parameter) The details regarding function name and the parameter are different, but the principles are the same and BenBolker's advice is also valid. – IRTFM Aug 24 '13 at 17:39
  • 3
    Thanks, DWin. You are right. Either of the following functions work: > optim( .1, function(x) abs(pbinom(q=5,size=10, x) - 0.9) ) or > optim( .1, function(x) abs(pbinom(q=5,size=10, x,lower.tail=FALSE) - 0.1) ) – Ursus Frost Aug 24 '13 at 17:55
  • 1
    Ursus Frost: why not post your comment (and a link to @DWin's previous post) as an answer? – Ben Bolker Aug 24 '13 at 18:39

0 Answers0