gnorm: Graphing a Normal Distribution (from Brett Larget)

View source: R/gnorm.R

gnormR Documentation

Graphing a Normal Distribution (from Brett Larget)

Description

gnorm plots a density function for a normal distribution of specified mean and standard deviation. It will also accept specification of one, or two "cutpoints" and shade the corresponding tail regions or the region between two cutpoints. The function also displays the corresponding tail or region probability.

Usage

gnorm(mu, sigma, a = NA, b = NA, findquantile = NA)

Arguments

mu

mu is the Normal Distribution mean. Required. Use 0 for std normal.

sigma

sigma is the Normal Distribution Std Deviation. Required. Use 1.0 for std normal.

a

optional specification of a quantile value that can serve as a "cutpoint". gnorm will shade the tail region demarcated by this value. a can be used in conjunction with b to find probabilities between the two values.

b

optional specification of a quantile value that can serve as a "cutpoint". gnorm will shade the tail region demarcated by this value. b can be used in conjunction with a to find probabilities between the two values.

findquantile

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

Note

This function can be very helpful in an instructional setting.

Author(s)

Bruce Dudek bruce.dudek@albany.edu

References

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

See Also

pgnorm, pgnormz, qgnorm, qgnormz

Examples


gnorm(0,1)
gnorm(0,1,a=1.65)
gnorm(0,1,a=-1.65)
gnorm(0,1,b=1.65)
gnorm(0,1,a=1.65,b=1.65)
gnorm(0,1,a=1.96,b=-1.65)
gnorm(100,15,a=130)
gnorm(100,15,a=85)
gnorm(100,15,a=85,b=115)
gnorm(800,20,a=837,b=763)


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