| 1 |
\name{p.dnorm} |
| 2 |
\alias{p.dnorm} |
| 3 |
\alias{p.dchisq} |
| 4 |
\alias{p.dgamma} |
| 5 |
\title{Plot Parametric Density Functions} |
| 6 |
\description{ |
| 7 |
These are utilities for pretty plotting of often used parametric |
| 8 |
densities. |
| 9 |
} |
| 10 |
\usage{ |
| 11 |
p.dnorm (mu = 0, s = 1, h0.col = "light gray", |
| 12 |
ms.lines = TRUE, ms.col = "gray", ...) |
| 13 |
p.dchisq(nu, h0.col = "light gray", ...) |
| 14 |
p.dgamma(shape, h0.col = "light gray", ...) |
| 15 |
} |
| 16 |
\arguments{ |
| 17 |
\item{mu,s}{numbers, the mean and standard deviation of the normal |
| 18 |
distribution.} |
| 19 |
\item{nu}{positive number, the degrees of freedom \code{df} argument |
| 20 |
for the \eqn{\chi^2}{chi^2}-density function \code{\link{dchisq}}.} |
| 21 |
\item{shape}{number, the \code{shape} parameter for the Gamma |
| 22 |
distribution.} |
| 23 |
\item{h0.col}{color specification for the line \eqn{y = 0}.} |
| 24 |
\item{ms.lines}{logical, used for the normal only: should lines be |
| 25 |
drawn at the mean and \eqn{\pm}{+-} 1 standard deviation.} |
| 26 |
\item{ms.col}{color for the \code{ms} lines if \code{ms.lines} is TRUE.} |
| 27 |
\item{\dots}{further parameter passed to \code{\link{curve}()}, e.g., |
| 28 |
\code{add = TRUE} for adding to current plot.} |
| 29 |
} |
| 30 |
\author{Werner Stahel et al.} |
| 31 |
\seealso{the underlying density functions, |
| 32 |
\code{\link{dnorm}}, \code{\link{dchisq}}, \code{\link{dgamma}}.} |
| 33 |
\examples{ |
| 34 |
p.dnorm() |
| 35 |
p.dnorm(mu=1.5, add = TRUE, ms.lines = FALSE) # add to the plot above |
| 36 |
|
| 37 |
p.dchisq(2, main= "Chi^2 Densities -- nu = 2,3,4") |
| 38 |
p.dchisq(3, add = TRUE, col = "red") |
| 39 |
p.dchisq(4, add = TRUE, col = "blue") |
| 40 |
|
| 41 |
op <- par(mfrow = c(2,2), mgp = c(1.6, 0.6,0), mar = c(3,3,1,1)) |
| 42 |
for(sh in 1:4) |
| 43 |
p.dgamma(sh) |
| 44 |
par(op) |
| 45 |
} |
| 46 |
\keyword{hplot} |
| 47 |
\keyword{utilities} |