I think this is a rather common problem, but I could not find a solution.
I want to solve the following equation: pbinom(18,25,p)=0.05.
Is there a way to find the unknown p with the program R?
Every help is appreciated.
I think this is a rather common problem, but I could not find a solution.
I want to solve the following equation: pbinom(18,25,p)=0.05.
Is there a way to find the unknown p with the program R?
Every help is appreciated.
Trusky
On
Brute force :
p = 0.0001 # starting point
while (abs(pbinom(18,25,p) - 0.05) > 0.001) p <- p + 0.001
This code evaluates the pdf for different values of p until you are "close enough" to 0.05. Here "close enough" means at the 0.001 range.
> p [1] 0.8601 > pbinom(18,25,0.8601) [1] 0.05070763
Copyright © 2021 Jogjafile Inc.
Root finding: