Learn R Programming

mosaic (version 0.8-1)

cdist: Central portion of a distribution

Description

This function determines the critial values for isolating a central portion of a distribution with a specified probability. This is designed to work especially well for symmteric distributions, but it can be used with any distribution.

Usage

cdist(dist, p, ..., tail = c("upper", "lower"), warn = TRUE)

Arguments

dist
a character string naming a distribution family (e.g., "norm"). This wil work for any family for which the usual d/p/q functions exist.
p
the proportion to be in the central region, with equal proportions in either "tail".
...
additional arguments passed to the distribution functions. Typically these specify the parameters of the particular distribution desired. See the examples.
tail
one of "upper" or "lower" specifying whether the lower or upper critical value is returned.
warn
a logical indicating whether a warning should be given when using a distribution that is not symmetric.

Examples

Run this code
cdist( "norm", .95)
cdist( "t", c(.90, .95, .99), df=5)
cdist( "t", c(.90, .95, .99), df=50)
cdist( "t", .95, df=c(3,5,10,20) )
cdist( "norm", .95, mean=500, sd=100 )
cdist( "chisq", c(.90, .95), df=3 )
cdist( "chisq", c(.90, .95), df=3, tail="lower" )

Run the code above in your browser using DataLab