gbinom: Graph of the Binomial Distribution with point and region...

View source: R/gbinom.R

gbinomR Documentation

Graph of the Binomial Distribution with point and region probabilities illustrated.

Description

Binomial Distributions of an N and p values can be plotted. Scale limits can be specified, as well as regions of the RV scale for determining probabilities. These regions are indicated with color on the graph and probabilities are also displayed.

Usage

gbinom(n, p, low = 0, high = n, scale = F, a = NA, b = NA, findquantile = NA)

Arguments

n

Number of trials.

p

Probability of a Success.

low

Lower limit of the X axis scale. Set to zero by default.

high

Upper limit of the X axis scale. Set to N, the number of trials, by default.

scale

Truncates the scale when TRUE. Shows full scale when FALSE

a

Arguments a and/or b can be used to set regions of the RV scale for which to color code and compute probabilities. See the examples below for several illustrations. The a value would typically be the smaller value if both a and b are used.

b

Arguments a and/or b can be used to set regions of the RV scale for which to color code and compute probabilities. See the examples below for several illustrations. The a value would typically be the smaller value if both a and b are used.

findquantile

Takes a cumulative left tail probability for which a quantile is returned. Default is NA. Arguments a and b override findquantile

Author(s)

Bruce Dudek bruce.dudek@albany.edu

References

This function is a modification of a function originally coded by Brett Larget, Univ. Wisconsin.
http://www.stat.wisc.edu/~larget/R/prob.R

Examples


gbinom(4,.5)
gbinom(100,.5)
gbinom(4,.4)
gbinom(10,.4)
gbinom(25,.7)
gbinom(4,.5,a=3)
gbinom(4,.5,b=1)
gbinom(4,.5,a=3,b=1)
gbinom(100,.667,a=60,b=70)
# improve the previous graph by resetting the x axis limits
gbinom(100,.667,a=60,b=70,low=45,high=85)


bcdudek/bcdstats documentation built on Jan. 3, 2024, 10:09 p.m.