pgeom function
This function returns the value of the geometric cumulative density function. Also, this function is used to find the probability of experiencing a certain amount of failures or fewer before experiencing the first success in a series of Bernoulli.
Syntax: pgeom(q, prob)
Parameters:
- q: number of failures before the first success
- prob: probability of success on a given trial
Example:
In this example, we are calculating the probability of a man asking for help, and the probability of getting the help is 0.6(p=0.6) so with the use of the pgeom() function we are calculating the probability that the person will have to talk to 8 or less people to find someone who helps.
R
pgeom (q=8, prob=.6) |
Output:
[1] 0.9997379
The probability that the person will have to talk to 8 or less people to find someone who supports the law is 0.9997379
A Guide to dgeom, pgeom, qgeom, and rgeom in R
In this article, we will be looking at a guide to the dgeom, pgeom, qgeom, and rgeom methods of the geometric distribution in the R programming language.