qgeom function
This function returns the value of the inverse geometric cumulative density function. Also, this function finds the number of failures that corresponds to a certain percentile.
Syntax: qgeom(p, prob)
Parameters:
- p: percentile
- 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.4(p=0.4) so with the use of the qgeom() function, we are calculating the probability that how many “failures” would the person need to experience to be at the 70th percentile for a number of failures before the first success.
R
qgeom (p=.70, prob=0.4) |
Output:
[1] 2
The person would need to experience 10 “failures” to be at the 70th percentile for a number of failures before the first success.
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.