The Gamma distribution, parameterized by mean and standard deviation
Source:R/distributions.R
GammaDist.RdDensity, distribution, and quantile functions for the gamma distribution,
accepting either the native shape / rate (or scale) parameters or a
mean and sd, which override them. Useful with distr() and
add_integration(), where covariate moments come straight from a published
baseline table. The moment parameterization uses
shape = (mean / sd)^2 and rate = mean / sd^2.
Usage
qgamma(
p,
shape,
rate = 1,
scale = 1/rate,
lower.tail = TRUE,
log.p = FALSE,
...,
mean,
sd
)
pgamma(
q,
shape,
rate = 1,
scale = 1/rate,
lower.tail = TRUE,
log.p = FALSE,
...,
mean,
sd
)
dgamma(x, shape, rate = 1, scale = 1/rate, log = FALSE, ..., mean, sd)Arguments
- p
Vector of probabilities.
- shape, rate, scale
See stats::GammaDist.
- lower.tail, log.p, log
See stats::GammaDist.
- ...
Must be empty; it keeps
meanandsdout of partial matching.- mean, sd
Mean and standard deviation, overriding
shapeandrate/scalewhen both are supplied. Both must be named in full.- x, q
Vector of quantiles.