Event | R formula |
first success on the kth trial | dgeom(k-1,p) |
first success on or before the kth trial | pgeom(k-1,p) |
first success before the kthtrial | pgeom(k-2,p) |
first success on or after the kthtrial | 1-pgeom(k-2,p) |
first success after the kthtrial | 1-pgeom(k-1,p) |
first success between the jth and kth trial, inclusive | pgeom(k-1,p)-pgeom(j-2,p) |
first success before the jth trial or after the kth trial | 1+pgeom(j-2,p)-pgeom(k-1,p) |
Event | R formula |
rth success on the kth trial | dnbinom(k-r,r,p) |
rth success on or before the kth trial | pnbinom(k-r,r,p) |
rth success before the kthtrial | pnbinom(k-r-1,r,p) |
rth success on or after the kthtrial | 1-pnbinom(k-r-1,r,p) |
rth success after the kthtrial | 1-pnbinom(k-r,r,p) |
rth success between the jth and kth trial, inclusive | pnbinom(k-r,r,p)-pnbinom(j-r-1,r,p) |
rth success before the jth trial or after the kth trial | 1-pnbinom(k-r,r,p)+pnbinom(j-r-1,r,p) |
Event | R formula | Spreadsheet Formula |
Y is less than y | pnorm(y,mu,sigma) | =NORMDIST(y,mu,sigma,TRUE) |
Y is greater than y | 1-pnorm(y,mu,sigma) | =1-NORMDIST(y,mu,sigma,TRUE) |
Y is greater than y or less than z | 1-pnorm(y,mu,sigma)+pnorm(z,mu,sigma) | =1-NORMDIST(y,mu,sigma,TRUE)+NORMDIST(z,mu,sigma,TRUE) |
Y is between z and y | pnorm(y,mu,sigma)-pnorm(z,mu,sigma) | =NORMDIST(y,mu,sigma,TRUE)-NORMDIST(z,mu,sigma,TRUE) |