Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ssd_fit_dists

Fit Distributions


Description

Fits one or more distributions to species sensitivity data.

Usage

ssd_fit_dists(
  data,
  left = "Conc",
  right = left,
  weight = NULL,
  dists = c("llogis", "gamma", "lnorm"),
  computable = FALSE,
  silent = FALSE
)

Arguments

data

A data frame.

left

A string of the column in data with the concentrations.

right

A string of the column in data with the right concentration values.

weight

A string of the column in data with the weightings (or NULL)

dists

A character vector of the distribution names.

computable

A flag specifying whether to only return fits with numerically computable standard errors.

silent

A flag indicating whether fits should fail silently.

Details

By default the 'llogis', 'gamma' and 'lnorm' distributions are fitted to the data. The ssd_fit_dists function has also been tested with the 'gompertz', 'lgumbel' and 'weibull' distributions.

If weight specifies a column in the data frame with positive integers, weighted estimation occurs. However, currently only the resultant parameter estimates are available (via coef).

If the right argument is different to the left argument then the data are considered to be censored.

The fits are performed using fitdistrplus::fitdist() (and fitdistrplus::fitdistcens() in the case of censored data). The method used is "mle" (maximum likelihood estimation) which means that numerical optimization is carried out in fitdistrplus::mledist() using stats::optim() unless finite bounds are supplied in the (lower and upper) in which it is carried out using stats::constrOptim(). In both cases the "Nelder-Mead" method is used.

Value

An object of class fitdists (a list of fitdistrplus::fitdist() objects).

Examples

ssd_fit_dists(boron_data)
data(fluazinam, package = "fitdistrplus")
ssd_fit_dists(fluazinam, left = "left", right = "right")

ssdtools

Species Sensitivity Distributions

v0.3.3
Apache License (== 2.0) | file LICENSE
Authors
Joe Thorley [aut, cre, ctr] (<https://orcid.org/0000-0002-7683-4592>), Carl Schwarz [aut, ctr], Angeline Tillmanns [ctb], Ali Azizishirazi [ctb], Rebecca Fisher [ctb], David Fox [ctb], Kathleen McTavish [ctb], Heather Thompson [ctb], Andy Teucher [ctb], Emilie Doussantousse [ctb], Stephanie Hazlitt [ctb], Nadine Hussein [ctb], Nan-Hung Hsieh [ctb], Sergio Ibarra Espinosa [ctb], Province of British Columbia [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.