View source: R/fct_inspection.R
fit_dist | R Documentation |
This function fits statistical distributions to a user-defined parameter.
fit_dist(df, param, dist = c("norm", "beta", "gamma", "lnorm"))
df |
a dataframe. |
param |
character. Name of variable of the dataframe on which to fit the distributions. |
dist |
character or vector of character. Determine which distribution to fit on the density plot. |
The available distributions are: "norm" (normal), "beta", "gamma", "lnorm" (lognormal). The arguments of the lists are "AIC" which contains the Akaike Information Criteria for each fitted distribution and "Dist_parameters" which contains the parameters of the fitted distributions. The distributions are fitted using the fitdistrplus::fitdist()
A list with two objects:
Statistical_fit: a dataframe containing the statistical fit criteria of the fitted distributions.
Dist_parameters: a dataframe containing the parameter value of the fitted distributions.
# Fitting normal and beta distribution to the "u_pfs" variable of the example dataframe.
data(df_pa)
fit_dist(df = df_pa,
param = "u_pfs",
dist = c("norm", "beta"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.