fit_distr_fun | R Documentation |
Given the name of a family of 1-dimensional distributions, this function chooses a
particular member of the family that fits the data and returns a function in the
selected p, d, q, or r format. When analytical solutions do not exist, MASS::fitdistr()
is used to estimate the parameters by numerical maximum likelihood.
fit_distr_fun(data, formula, dist, start = NULL, ...)
data |
A data frame. |
formula |
A formula. A distribution will be fit to the data defined by the
right side and evaluated in |
dist |
A string naming the function desired. Tyically this will be
"d", "p", "q", or "r" followed by the (abbrevation for) a family of
distributions such as "pnorm", "rgamma". Fitting is done use
|
start |
Starting values for the numerical maximum likelihood method
(passed to |
... |
Additional arguments to MASS::fitdistr() |
A function of one variable that acts like, say,
pnorm()
, dnorm()
, qnorm()
, or rnorm()
, but with the default
values of the parameters set to their maximum likelihood estimates.
fit_distr_fun( ~ cesd, data = mosaicData::HELPrct, dist = "dnorm")
fit_distr_fun( ~ cesd, data = mosaicData::HELPrct, dist = "pnorm")
fit_distr_fun( ~ cesd, data = mosaicData::HELPrct, dist = "qpois")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.