Title: | Species Sensitivity Distributions |
---|---|
Description: | Species sensitivity distributions are cumulative probability distributions which are fitted to toxicity concentrations for different species as described by Posthuma et al.(2001) <isbn:9781566705783>. The ssdtools package uses Maximum Likelihood to fit distributions such as the gamma, log-logistic, log-normal and log-normal log-normal mixture. Multiple distributions can be averaged using Akaike Information Criteria. Confidence intervals on hazard concentrations and proportions are produced by parametric bootstrapping. |
Authors: | Joe Thorley [aut, cre] , Rebecca Fisher [aut], David Fox [aut], Carl Schwarz [aut], Angeline Tillmanns [ctb], Seb Dalgarno [ctb] , Kathleen McTavish [ctb], Heather Thompson [ctb], Doug Spry [ctb], Rick van Dam [ctb], Graham Batley [ctb], Tony Bigwood [ctb], Ali Azizishirazi [ctb], Nadine Hussein [ctb] , Sarah Lyons [ctb] , Stephanie Hazlitt [ctb], Hadley Wickham [ctb], Sergio Ibarra Espinosa [ctb], Andy Teucher [ctb], Emilie Doussantousse [ctb], Nan-Hung Hsieh [ctb], Province of British Columbia [fnd, cph], Environment and Climate Change Canada [fnd, cph], Australian Government Department of Climate Change, Energy, the Environment and Water [fnd, cph] |
Maintainer: | Joe Thorley <[email protected]> |
License: | Apache License (== 2.0) | file LICENSE |
Version: | 2.1.0.9000 |
Built: | 2024-11-20 06:08:31 UTC |
Source: | https://github.com/poissonconsulting/ssdtools |
Get a tibble of the original data with augmentation.
## S3 method for class 'fitdists' augment(x, ...)
## S3 method for class 'fitdists' augment(x, ...)
x |
The object. |
... |
Unused. |
A tibble of the agumented data.
Other generics:
glance.fitdists()
,
tidy.fitdists()
fits <- ssd_fit_dists(ssddata::ccme_boron) augment(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) augment(fits)
A wrapper on ssd_plot_cdf()
.
## S3 method for class 'fitdists' autoplot(object, ...)
## S3 method for class 'fitdists' autoplot(object, ...)
object |
The object. |
... |
Unused. |
A ggplot object.
fits <- ssd_fit_dists(ssddata::ccme_boron) autoplot(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) autoplot(fits)
A data frame of the predictions based on 1,000 bootstrap iterations.
boron_pred
boron_pred
An object of class tbl_df
(inherits from tbl
, data.frame
) with 99 rows and 11 columns.
The proportion of species affected (int).
The estimated concentration (dbl).
The standard error of the estimate (dbl).
The lower confidence limit (dbl).
The upper confidence limit (dbl).
The distribution (chr).
## Not run: fits <- ssd_fit_dists(ssddata::ccme_boron) set.seed(99) boron_pred <- predict(fits, ci = TRUE) ## End(Not run) head(boron_pred)
## Not run: fits <- ssd_fit_dists(ssddata::ccme_boron) set.seed(99) boron_pred <- predict(fits, ci = TRUE) ## End(Not run) head(boron_pred)
A wrapper on tidy.fitdists()
.
## S3 method for class 'fitdists' coef(object, ...)
## S3 method for class 'fitdists' coef(object, ...)
object |
The object. |
... |
Unused. |
fits <- ssd_fit_dists(ssddata::ccme_boron) coef(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) coef(fits)
Comma and Significance Formatter
comma_signif(x, digits = 3, ..., big.mark = ",")
comma_signif(x, digits = 3, ..., big.mark = ",")
x |
A numeric vector to format. |
digits |
A whole number specifying the number of significant figures. |
... |
Unused. |
big.mark |
A string specifying used between every 3 digits to separate thousands on the x-axis. |
A character vector.
## Not run: comma_signif(c(0.1, 1, 10, 1000, 10000)) ## End(Not run)
## Not run: comma_signif(c(0.1, 1, 10, 1000, 10000)) ## End(Not run)
dgompertz(x, llocation = 0, lshape = 0, log = FALSE)
dgompertz(x, llocation = 0, lshape = 0, log = FALSE)
x |
A numeric vector of values. |
llocation |
location parameter on the log scale. |
lshape |
shape parameter on the log scale. |
log |
logical; if TRUE, probabilities p are given as log(p). |
A numeric vector.
A data frame of information on the implemented distributions.
dist_data
dist_data
An object of class tbl_df
(inherits from tbl
, data.frame
) with 10 rows and 4 columns.
The distribution (chr).
The number of parameters (int).
Whether the distribution has both tails (flag).
Whether the distribution is numerically stable (flag).
Whether the distribution belongs to the set of distributions approved by BC, Canada, Australia and New Zealand for official guidelines (flag).
Other dists:
ssd_dists()
,
ssd_dists_all()
dist_data
dist_data
Log-Gumbel (Inverse Weibull) Probability Density
dlgumbel(x, locationlog = 0, scalelog = 1, log = FALSE)
dlgumbel(x, locationlog = 0, scalelog = 1, log = FALSE)
x |
A numeric vector of values. |
locationlog |
location on the log scale parameter. |
scalelog |
scale on log scale parameter. |
log |
logical; if TRUE, probabilities p are given as log(p). |
A numeric vector.
Gets a named list of the estimated weights and parameters.
## S3 method for class 'fitdists' estimates(x, all_estimates = FALSE, ...)
## S3 method for class 'fitdists' estimates(x, all_estimates = FALSE, ...)
x |
The object. |
all_estimates |
A flag specifying whether to calculate estimates for all implemented distributions. |
... |
Unused. |
A named list of the estimates.
tidy.fitdists()
, ssd_match_moments()
, ssd_hc()
and ssd_plot_cdf()
fits <- ssd_fit_dists(ssddata::ccme_boron) estimates(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) estimates(fits)
Plots the intersection between each xintercept
and yintercept
value.
geom_hcintersect( mapping = NULL, data = NULL, ..., xintercept, yintercept, na.rm = FALSE, show.legend = NA )
geom_hcintersect( mapping = NULL, data = NULL, ..., xintercept, yintercept, na.rm = FALSE, show.legend = NA )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
... |
Other arguments passed on to
|
xintercept |
The x-value for the intersect |
yintercept |
The y-value for the intersect. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
Other ggplot:
geom_ssdpoint()
,
geom_ssdsegment()
,
geom_xribbon()
,
scale_colour_ssd()
,
ssd_pal()
ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + geom_ssdpoint() + geom_hcintersect(xintercept = 1.5, yintercept = 0.05)
ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + geom_ssdpoint() + geom_hcintersect(xintercept = 1.5, yintercept = 0.05)
geom_ssd()
has been deprecated for geom_ssdpoint()
.
geom_ssd( mapping = NULL, data = NULL, stat = "ssdpoint", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
geom_ssd( mapping = NULL, data = NULL, stat = "ssdpoint", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
## Not run: ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + geom_ssd() ## End(Not run)
## Not run: ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + geom_ssd() ## End(Not run)
Uses the empirical cumulative distribution to create scatterplot of points x
.
geom_ssdpoint( mapping = NULL, data = NULL, stat = "ssdpoint", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
geom_ssdpoint( mapping = NULL, data = NULL, stat = "ssdpoint", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
Other ggplot:
geom_hcintersect()
,
geom_ssdsegment()
,
geom_xribbon()
,
scale_colour_ssd()
,
ssd_pal()
ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + geom_ssdpoint()
ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + geom_ssdpoint()
Uses the empirical cumulative distribution to draw lines between points x
and xend
.
geom_ssdsegment( mapping = NULL, data = NULL, stat = "ssdsegment", position = "identity", ..., arrow = NULL, arrow.fill = NULL, lineend = "butt", linejoin = "round", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
geom_ssdsegment( mapping = NULL, data = NULL, stat = "ssdsegment", position = "identity", ..., arrow = NULL, arrow.fill = NULL, lineend = "butt", linejoin = "round", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
arrow |
specification for arrow heads, as created by |
arrow.fill |
fill colour to use for the arrow head (if closed). |
lineend |
Line end style (round, butt, square). |
linejoin |
Line join style (round, mitre, bevel). |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
Other ggplot:
geom_hcintersect()
,
geom_ssdpoint()
,
geom_xribbon()
,
scale_colour_ssd()
,
ssd_pal()
ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc, xend = Conc * 2)) + geom_ssdsegment()
ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc, xend = Conc * 2)) + geom_ssdsegment()
Plots the x
interval defined by xmin
and xmax
.
geom_xribbon( mapping = NULL, data = NULL, stat = "identity", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
geom_xribbon( mapping = NULL, data = NULL, stat = "identity", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
Other ggplot:
geom_hcintersect()
,
geom_ssdpoint()
,
geom_ssdsegment()
,
scale_colour_ssd()
,
ssd_pal()
gp <- ggplot2::ggplot(boron_pred) + geom_xribbon(ggplot2::aes(xmin = lcl, xmax = ucl, y = proportion))
gp <- ggplot2::ggplot(boron_pred) + geom_xribbon(ggplot2::aes(xmin = lcl, xmax = ucl, y = proportion))
Gets a tibble with a single row for each distribution.
## S3 method for class 'fitdists' glance(x, ...)
## S3 method for class 'fitdists' glance(x, ...)
x |
The object. |
... |
Unused. |
A tidy tibble of the distributions.
Other generics:
augment.fitdists()
,
tidy.fitdists()
fits <- ssd_fit_dists(ssddata::ccme_boron) glance(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) glance(fits)
Deprecated for ssd_is_censored()
.
is_censored(x)
is_censored(x)
x |
A fitdists object. |
A flag indicating if the data is censored.
Tests whether x is a fitdists Object.
is.fitdists(x)
is.fitdists(x)
x |
The object. |
A flag specifying whether x is a fitdists Object.
fits <- ssd_fit_dists(ssddata::ccme_boron) is.fitdists(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) is.fitdists(fits)
Parameter Descriptions for ssdtools Functions
... |
Unused. |
add_x |
The value to add to the label x values (before multiplying by |
all |
A flag specifying whether to also return transformed parameters. |
all_dists |
A flag specifying whether all the named distributions must fit successfully. |
at_boundary_ok |
A flag specifying whether a model with one or more parameters at the boundary should be considered to have converged (default = FALSE). |
average |
A flag specifying whether to provide model averaged values as opposed to a value for each distribution. |
bcanz |
A flag or NULL specifying whether to only include distributions in the set that is approved by BC, Canada, Australia and New Zealand for official guidelines. |
big.mark |
A string specifying used between every 3 digits to separate thousands on the x-axis. |
breaks |
A character vector |
bounds |
A named non-negative numeric vector of the left and right bounds for uncensored missing (0 and Inf) data in terms of the orders of magnitude relative to the extremes for non-missing values. |
chk |
A flag specifying whether to check the arguments. |
ci |
A flag specifying whether to estimate confidence intervals (by bootstrapping). |
censoring |
A numeric vector of the left and right censoring values. |
color |
A string of the column in data for the color aesthetic. |
computable |
A flag specifying whether to only return fits with numerically computable standard errors. |
conc |
A numeric vector of concentrations to calculate the hazard proportions for. |
control |
A list of control parameters passed to |
data |
A data frame. |
delta |
A non-negative number specifying the maximum absolute AIC difference cutoff. Distributions with an absolute AIC difference greater than delta are excluded from the calculations. |
digits |
A whole number specifying the number of significant figures. |
dists |
A character vector of the distribution names. |
fitdists |
An object of class fitdists. |
hc |
A value between 0 and 1 indicating the proportion hazard concentration (or NULL). |
label |
A string of the column in data with the labels. |
left |
A string of the column in data with the concentrations. |
level |
A number between 0 and 1 of the confidence level of the interval. |
linecolor |
A string of the column in pred to use for the line color. |
linetype |
A string of the column in pred to use for the linetype. |
llocation |
location parameter on the log scale. |
location |
location parameter. |
locationlog |
location on the log scale parameter. |
locationlog1 |
locationlog1 parameter. |
locationlog2 |
locationlog2 parameter. |
log |
logical; if TRUE, probabilities p are given as log(p). |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
lscale |
scale parameter on the log scale. |
lshape |
shape parameter on the log scale. |
lshape1 |
shape1 parameter on the log scale. |
lshape2 |
shape2 parameter on the log scale. |
lower.tail |
logical; if TRUE (default), probabilities are |
meanlog |
mean on log scale parameter. |
meanlog1 |
mean on log scale parameter. |
meanlog2 |
mean on log scale parameter. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
min_pmix |
A number between 0 and 0.5 specifying the minimum proportion in mixture models. |
npars |
A whole numeric vector specifying which distributions to include based on the number of parameters. |
all_estimates |
A flag specifying whether to calculate estimates for all implemented distributions. |
ci_method |
A string specifying which method to use for estimating the bootstrap values. Possible values are "multi_free" and "multi_fixed" which treat the distributions as constituting a single distribution but differ in whether the model weights are fixed and "weighted_samples" and "weighted_arithmetic" take bootstrap samples from each distribution proportional to its weight versus calculating the weighted arithmetic means of the lower and upper confidence limits. |
multi_est |
A flag specifying whether to treat the distributions as constituting a single distribution (as opposed to taking the mean) when calculating model averaged estimates. |
na.rm |
A flag specifying whether to silently remove missing values or remove them with a warning. |
n |
positive number of observations. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
nrow |
A positive whole number of the minimum number of non-missing rows. |
nsim |
A positive whole number of the number of simulations to generate. |
object |
The object. |
parametric |
A flag specifying whether to perform parametric bootstrapping as opposed to non-parametrically resampling the original data with replacement. |
p |
vector of probabilities. |
percent |
A numeric vector of percent values to estimate hazard concentrations for. Soft-deprecated for |
pmix |
Proportion mixture parameter. |
proportion |
A numeric vector of proportion values to estimate hazard concentrations for. |
pvalue |
A flag specifying whether to return p-values or the statistics (default) for the various tests. |
pred |
A data frame of the predictions. |
q |
vector of quantiles. |
range_shape1 |
A numeric vector of length two of the lower and upper bounds for the shape1 parameter. |
range_shape2 |
shape2 parameter. |
reweight |
A flag specifying whether to reweight weights by dividing by the largest weight. |
rescale |
A flag specifying whether to rescale concentration values by dividing by the geometric mean of the minimum and maximum positive finite values. |
ribbon |
A flag indicating whether to plot the confidence interval as a grey ribbon as opposed to green solid lines. |
right |
A string of the column in data with the right concentration values. |
save_to |
NULL or a string specifying a directory to save where the bootstrap datasets and parameter estimates (when successfully converged) to. |
samples |
A flag specfying whether to include a numeric vector of the bootstrap samples as a list column in the output. |
scale |
scale parameter. |
scalelog1 |
scalelog1 parameter. |
scalelog2 |
scalelog2 parameter. |
scalelog |
scale on log scale parameter. |
sdlog |
standard deviation on log scale parameter. |
sdlog1 |
standard deviation on log scale parameter. |
sdlog2 |
standard deviation on log scale parameter. |
select |
A character vector of the distributions to select. |
shape |
shape parameter. |
shape1 |
shape1 parameter. |
shape2 |
shape2 parameter. |
shift_x |
The value to multiply the label x values by (after adding |
silent |
A flag indicating whether fits should fail silently. |
size |
A number for the size of the labels. |
suffix |
Additional text to display after the number on the y-axis. |
tails |
A flag or NULL specifying whether to only include distributions with both tails. |
trans |
A string which transformation to use by default |
weight |
A string of the numeric column in data with positive weights less than or equal to 1,000 or NULL. |
x |
The object. |
xbreaks |
The x-axis breaks as one of:
|
xintercept |
The x-value for the intersect |
xlab |
A string of the x-axis label. |
yintercept |
The y-value for the intersect. |
ylab |
A string of the x-axis label. |
burrIII3.weight |
weight parameter for the Burr III distribution. |
burrIII3.shape1 |
shape1 parameter for the Burr III distribution. |
burrIII3.shape2 |
shape2 parameter for the Burr III distribution. |
burrIII3.scale |
scale parameter for the Burr III distribution. |
gamma.weight |
weight parameter for the gamma distribution. |
gamma.shape |
shape parameter for the gamma distribution. |
gamma.scale |
scale parameter for the gamma distribution. |
gompertz.weight |
weight parameter for the Gompertz distribution. |
gompertz.location |
location parameter for the Gompertz distribution. |
gompertz.shape |
shape parameter for the Gompertz distribution. |
invpareto.weight |
weight parameter for the inverse Pareto distribution. |
invpareto.shape |
shape parameter for the inverse Pareto distribution. |
invpareto.scale |
scale parameter for the inverse Pareto distribution. |
lgumbel.weight |
weight parameter for the log-Gumbel distribution. |
lgumbel.locationlog |
location parameter for the log-Gumbel distribution. |
lgumbel.scalelog |
scale parameter for the log-Gumbel distribution. |
llogis.weight |
weight parameter for the log-logistic distribution. |
llogis.locationlog |
location parameter for the log-logistic distribution. |
llogis.scalelog |
scale parameter for the log-logistic distribution. |
llogis_llogis.weight |
weight parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog1 |
locationlog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog1 |
scalelog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog2 |
locationlog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog2 |
scalelog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.pmix |
pmix parameter for the log-logistic log-logistic mixture distribution. |
lnorm.weight |
weight parameter for the log-normal distribution. |
lnorm.meanlog |
meanlog parameter for the log-normal distribution. |
lnorm.sdlog |
sdlog parameter for the log-normal distribution. |
lnorm_lnorm.weight |
weight parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog1 |
meanlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog1 |
sdlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog2 |
meanlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog2 |
sdlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.pmix |
pmix parameter for the log-normal log-normal mixture distribution. |
weibull.weight |
weight parameter for the Weibull distribution. |
weibull.shape |
shape parameter for the Weibull distribution. |
weibull.scale |
scale parameter for the Weibull distribution. |
Cumulative Distribution Function for Gompertz Distribution
pgompertz(q, llocation = 0, lshape = 0, lower.tail = TRUE, log.p = FALSE)
pgompertz(q, llocation = 0, lshape = 0, lower.tail = TRUE, log.p = FALSE)
q |
vector of quantiles. |
llocation |
location parameter on the log scale. |
lshape |
shape parameter on the log scale. |
lower.tail |
logical; if TRUE (default), probabilities are |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
Cumulative Distribution Function for Log-Gumbel Distribution
plgumbel(q, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE)
plgumbel(q, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE)
q |
vector of quantiles. |
locationlog |
location on the log scale parameter. |
scalelog |
scale on log scale parameter. |
lower.tail |
logical; if TRUE (default), probabilities are |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
A wrapper on ssd_hc()
that by default calculates
all hazard concentrations from 1 to 99%.
## S3 method for class 'fitburrlioz' predict( object, percent, proportion = 1:99/100, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = TRUE, ... )
## S3 method for class 'fitburrlioz' predict( object, percent, proportion = 1:99/100, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = TRUE, ... )
object |
The object. |
percent |
A numeric vector of percent values to estimate hazard concentrations for. Soft-deprecated for |
proportion |
A numeric vector of proportion values to estimate hazard concentrations for. |
ci |
A flag specifying whether to estimate confidence intervals (by bootstrapping). |
level |
A number between 0 and 1 of the confidence level of the interval. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
parametric |
A flag specifying whether to perform parametric bootstrapping as opposed to non-parametrically resampling the original data with replacement. |
... |
Unused. |
It is useful for plotting purposes.
ssd_hc()
and ssd_plot()
fits <- ssd_fit_burrlioz(ssddata::ccme_boron) predict(fits)
fits <- ssd_fit_burrlioz(ssddata::ccme_boron) predict(fits)
A wrapper on ssd_hc()
that by default calculates
all hazard concentrations from 1 to 99%.
## S3 method for class 'fitdists' predict( object, percent, proportion = 1:99/100, average = TRUE, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, multi_est = TRUE, ci_method = "weighted_samples", parametric = TRUE, delta = 9.21, control = NULL, ... )
## S3 method for class 'fitdists' predict( object, percent, proportion = 1:99/100, average = TRUE, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, multi_est = TRUE, ci_method = "weighted_samples", parametric = TRUE, delta = 9.21, control = NULL, ... )
object |
The object. |
percent |
A numeric vector of percent values to estimate hazard concentrations for. Soft-deprecated for |
proportion |
A numeric vector of proportion values to estimate hazard concentrations for. |
average |
A flag specifying whether to provide model averaged values as opposed to a value for each distribution. |
ci |
A flag specifying whether to estimate confidence intervals (by bootstrapping). |
level |
A number between 0 and 1 of the confidence level of the interval. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
multi_est |
A flag specifying whether to treat the distributions as constituting a single distribution (as opposed to taking the mean) when calculating model averaged estimates. |
ci_method |
A string specifying which method to use for estimating the bootstrap values. Possible values are "multi_free" and "multi_fixed" which treat the distributions as constituting a single distribution but differ in whether the model weights are fixed and "weighted_samples" and "weighted_arithmetic" take bootstrap samples from each distribution proportional to its weight versus calculating the weighted arithmetic means of the lower and upper confidence limits. |
parametric |
A flag specifying whether to perform parametric bootstrapping as opposed to non-parametrically resampling the original data with replacement. |
delta |
A non-negative number specifying the maximum absolute AIC difference cutoff. Distributions with an absolute AIC difference greater than delta are excluded from the calculations. |
control |
A list of control parameters passed to |
... |
Unused. |
It is useful for plotting purposes.
ssd_hc()
and ssd_plot()
fits <- ssd_fit_dists(ssddata::ccme_boron) predict(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) predict(fits)
Quantile Function for Gompertz Distribution
qgompertz(p, llocation = 0, lshape = 0, lower.tail = TRUE, log.p = FALSE)
qgompertz(p, llocation = 0, lshape = 0, lower.tail = TRUE, log.p = FALSE)
p |
vector of probabilities. |
llocation |
location parameter on the log scale. |
lshape |
shape parameter on the log scale. |
lower.tail |
logical; if TRUE (default), probabilities are |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
Quantile Function for Log-Gumbel Distribution
qlgumbel(p, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE)
qlgumbel(p, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE)
p |
vector of probabilities. |
locationlog |
location on the log scale parameter. |
scalelog |
scale on log scale parameter. |
lower.tail |
logical; if TRUE (default), probabilities are |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
Random Generation for Gompertz Distribution
rgompertz(n, llocation = 0, lshape = 0)
rgompertz(n, llocation = 0, lshape = 0)
n |
positive number of observations. |
llocation |
location parameter on the log scale. |
lshape |
shape parameter on the log scale. |
Random Generation for log-Gumbel Distribution
rlgumbel(n, locationlog = 0, scalelog = 1)
rlgumbel(n, locationlog = 0, scalelog = 1)
n |
positive number of observations. |
locationlog |
location on the log scale parameter. |
scalelog |
scale on log scale parameter. |
Discrete color-blind scale for SSD Plots
scale_colour_ssd(...) scale_color_ssd(...) scale_fill_ssd(...)
scale_colour_ssd(...) scale_color_ssd(...) scale_fill_ssd(...)
... |
Arguments passed to |
scale_color_ssd()
: Discrete color-blind scale for SSD Plots
scale_fill_ssd()
: Discrete color-blind scale for SSD Plots
Other ggplot:
geom_hcintersect()
,
geom_ssdpoint()
,
geom_ssdsegment()
,
geom_xribbon()
,
ssd_pal()
ssd_plot(ssddata::ccme_boron, boron_pred, shape = "Group") + scale_colour_ssd()
ssd_plot(ssddata::ccme_boron, boron_pred, shape = "Group") + scale_colour_ssd()
Censor Data
ssd_censor_data(data, left = "Conc", ..., right = left, censoring = c(0, Inf))
ssd_censor_data(data, left = "Conc", ..., right = left, censoring = c(0, Inf))
data |
A data frame. |
left |
A string of the column in data with the concentrations. |
... |
Unused. |
right |
A string of the column in data with the right concentration values. |
censoring |
A numeric vector of the left and right censoring values. |
A tibble of the censored data.
ssd_censor_data(ssddata::ccme_boron, censoring = c(2.5, Inf))
ssd_censor_data(ssddata::ccme_boron, censoring = c(2.5, Inf))
Get a tibble of the original data.
ssd_data(x)
ssd_data(x)
x |
The object. |
A tibble of the original data.
augment.fitdists()
, ssd_ecd_data()
and ssd_sort_data()
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_data(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_data(fits)
Gets a character vector of the names of the available distributions.
ssd_dists(bcanz = NULL, tails = NULL, npars = 2:5)
ssd_dists(bcanz = NULL, tails = NULL, npars = 2:5)
bcanz |
A flag or NULL specifying whether to only include distributions in the set that is approved by BC, Canada, Australia and New Zealand for official guidelines. |
tails |
A flag or NULL specifying whether to only include distributions with both tails. |
npars |
A whole numeric vector specifying which distributions to include based on the number of parameters. |
A unique, sorted character vector of the distributions.
Other dists:
dist_data
,
ssd_dists_all()
ssd_dists() ssd_dists(bcanz = TRUE) ssd_dists(tails = FALSE) ssd_dists(npars = 5)
ssd_dists() ssd_dists(bcanz = TRUE) ssd_dists(tails = FALSE) ssd_dists(npars = 5)
Gets a character vector of the names of all the available distributions.
ssd_dists_all()
ssd_dists_all()
A unique, sorted character vector of the distributions.
Other dists:
dist_data
,
ssd_dists()
ssd_dists_all()
ssd_dists_all()
Gets a character vector of the names of the distributions adopted by BC, Canada, Australia and New Zealand for official guidelines.
ssd_dists_bcanz(npars = c(2L, 5L))
ssd_dists_bcanz(npars = c(2L, 5L))
npars |
A whole numeric vector specifying which distributions to include based on the number of parameters. |
A unique, sorted character vector of the distributions.
ssd_dists_bcanz() ssd_dists_bcanz(npars = 2)
ssd_dists_bcanz() ssd_dists_bcanz(npars = 2)
Default Parameter Estimates
ssd_eburrIII3() ssd_egamma() ssd_egompertz() ssd_einvpareto() ssd_elgumbel() ssd_elgumbel() ssd_ellogis_llogis() ssd_ellogis() ssd_elnorm_lnorm() ssd_elnorm() ssd_emulti() ssd_eweibull()
ssd_eburrIII3() ssd_egamma() ssd_egompertz() ssd_einvpareto() ssd_elgumbel() ssd_elgumbel() ssd_ellogis_llogis() ssd_ellogis() ssd_elnorm_lnorm() ssd_elnorm() ssd_emulti() ssd_eweibull()
ssd_eburrIII3()
: Default Parameter Values for BurrIII Distribution
ssd_egamma()
: Default Parameter Values for Gamma Distribution
ssd_egompertz()
: Default Parameter Values for Gompertz Distribution
ssd_einvpareto()
: Default Parameter Values for Inverse Pareto Distribution
ssd_elgumbel()
: Default Parameter Values for Log-Gumbel Distribution
ssd_elgumbel()
: Default Parameter Values for log-Gumbel Distribution
ssd_ellogis_llogis()
: Default Parameter Values for Log-Logistic/Log-Logistic Mixture Distribution
ssd_ellogis()
: Default Parameter Values for Log-Logistic Distribution
ssd_elnorm_lnorm()
: Default Parameter Values for Log-Normal/Log-Normal Mixture Distribution
ssd_elnorm()
: Default Parameter Values for Log-Normal Distribution
ssd_emulti()
: Default Parameter Values for Multiple Distributions
ssd_eweibull()
: Default Parameter Values for Log-Normal Distribution
ssd_eburrIII3() ssd_egamma() ssd_egompertz() ssd_einvpareto() ssd_einvpareto() ssd_elgumbel() ssd_ellogis_llogis() ssd_ellogis() ssd_elnorm_lnorm() ssd_elnorm() ssd_emulti() ssd_eweibull()
ssd_eburrIII3() ssd_egamma() ssd_egompertz() ssd_einvpareto() ssd_einvpareto() ssd_elgumbel() ssd_ellogis_llogis() ssd_ellogis() ssd_elnorm_lnorm() ssd_elnorm() ssd_emulti() ssd_eweibull()
Empirical Cumulative Density
ssd_ecd(x, ties.method = "first")
ssd_ecd(x, ties.method = "first")
x |
a numeric, complex, character or logical vector. |
ties.method |
a character string specifying how ties are treated, see ‘Details’; can be abbreviated. |
A numeric vector of the empirical cumulative density.
ssd_ecd(1:10)
ssd_ecd(1:10)
Empirical Cumulative Density for Species Sensitivity Data
ssd_ecd_data( data, left = "Conc", right = left, bounds = c(left = 1, right = 1) )
ssd_ecd_data( data, left = "Conc", right = left, bounds = c(left = 1, right = 1) )
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. |
bounds |
A named non-negative numeric vector of the left and right bounds for uncensored missing (0 and Inf) data in terms of the orders of magnitude relative to the extremes for non-missing values. |
A numeric vector of the empirical cumulative density for the rows in data.
ssd_ecd()
and ssd_data()
ssd_ecd_data(ssddata::ccme_boron)
ssd_ecd_data(ssddata::ccme_boron)
Calculates average proportion exposed based on log-normal distribution of concentrations.
ssd_exposure(x, meanlog = 0, sdlog = 1, nboot = 1000)
ssd_exposure(x, meanlog = 0, sdlog = 1, nboot = 1000)
x |
The object. |
meanlog |
The mean of the exposure concentrations on the log scale. |
sdlog |
The standard deviation of the exposure concentrations on the log scale. |
nboot |
The number of samples to use to calculate the exposure. |
The proportion exposed.
## Not run: fits <- ssd_fit_dists(ssddata::ccme_boron, dists = "lnorm") set.seed(10) ssd_exposure(fits) ssd_exposure(fits, meanlog = 1) ssd_exposure(fits, meanlog = 1, sdlog = 1) ## End(Not run)
## Not run: fits <- ssd_fit_dists(ssddata::ccme_boron, dists = "lnorm") set.seed(10) ssd_exposure(fits) ssd_exposure(fits, meanlog = 1) ssd_exposure(fits, meanlog = 1, sdlog = 1) ## End(Not run)
Fits distributions using settings adopted by BC, Canada, Australia and New Zealand for official guidelines.
ssd_fit_bcanz(data, left = "Conc", dists = ssd_dists_bcanz())
ssd_fit_bcanz(data, left = "Conc", dists = ssd_dists_bcanz())
data |
A data frame. |
left |
A string of the column in data with the concentrations. |
dists |
A character vector of the distribution names. |
An object of class fitdists.
Other BCANZ:
ssd_hc_bcanz()
,
ssd_hp_bcanz()
ssd_fit_bcanz(ssddata::ccme_boron)
ssd_fit_bcanz(ssddata::ccme_boron)
Fits 'burrIII3' distribution. If shape1 parameter is at boundary returns 'lgumbel' (which is equivalent to inverse Weibull). Else if shape2 parameter is at a boundary returns 'invpareto'. Otherwise returns 'burrIII3'
ssd_fit_burrlioz( data, left = "Conc", rescale = FALSE, control = list(), silent = FALSE )
ssd_fit_burrlioz( data, left = "Conc", rescale = FALSE, control = list(), silent = FALSE )
data |
A data frame. |
left |
A string of the column in data with the concentrations. |
rescale |
A flag specifying whether to rescale concentration values by dividing by the geometric mean of the minimum and maximum positive finite values. |
control |
A list of control parameters passed to |
silent |
A flag indicating whether fits should fail silently. |
An object of class fitdists.
ssd_fit_burrlioz(ssddata::ccme_boron)
ssd_fit_burrlioz(ssddata::ccme_boron)
Fits one or more distributions to species sensitivity data.
ssd_fit_dists( data, left = "Conc", right = left, weight = NULL, dists = ssd_dists_bcanz(), nrow = 6L, rescale = FALSE, reweight = FALSE, computable = FALSE, at_boundary_ok = TRUE, all_dists = FALSE, min_pmix = ssd_min_pmix(nrow(data)), range_shape1 = c(0.05, 20), range_shape2 = range_shape1, control = list(), silent = FALSE )
ssd_fit_dists( data, left = "Conc", right = left, weight = NULL, dists = ssd_dists_bcanz(), nrow = 6L, rescale = FALSE, reweight = FALSE, computable = FALSE, at_boundary_ok = TRUE, all_dists = FALSE, min_pmix = ssd_min_pmix(nrow(data)), range_shape1 = c(0.05, 20), range_shape2 = range_shape1, control = list(), silent = FALSE )
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 numeric column in data with positive weights less than or equal to 1,000 or NULL. |
dists |
A character vector of the distribution names. |
nrow |
A positive whole number of the minimum number of non-missing rows. |
rescale |
A flag specifying whether to rescale concentration values by dividing by the geometric mean of the minimum and maximum positive finite values. |
reweight |
A flag specifying whether to reweight weights by dividing by the largest weight. |
computable |
A flag specifying whether to only return fits with numerically computable standard errors. |
at_boundary_ok |
A flag specifying whether a model with one or more parameters at the boundary should be considered to have converged (default = FALSE). |
all_dists |
A flag specifying whether all the named distributions must fit successfully. |
min_pmix |
A number between 0 and 0.5 specifying the minimum proportion in mixture models. |
range_shape1 |
A numeric vector of length two of the lower and upper bounds for the shape1 parameter. |
range_shape2 |
shape2 parameter. |
control |
A list of control parameters passed to |
silent |
A flag indicating whether fits should fail silently. |
By default the 'gamma', 'lgumbel', 'llogis', 'lnorm', 'lnorm_lnorm' and
'weibull' distributions are fitted to the data.
For a complete list of the distributions that are currently implemented in
ssdtools
see ssd_dists_all()
.
If weight specifies a column in the data frame with positive numbers, weighted estimation occurs. However, currently only the resultant parameter estimates are available.
If the right
argument is different to the left
argument
then the data are considered to be censored.
An object of class fitdists.
fits <- ssd_fit_dists(ssddata::ccme_boron) fits ssd_plot_cdf(fits) ssd_hc(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) fits ssd_plot_cdf(fits) ssd_hc(fits)
Returns a tbl data frame with the following columns
The distribution name (chr)
Akaike's Information Criterion (dbl)
Bayesian Information Criterion (dbl)
and if the data are non-censored
Akaike's Information Criterion corrected for sample size (dbl)
and if there are 8 or more samples
Anderson-Darling statistic (dbl)
Kolmogorov-Smirnov statistic (dbl)
Cramer-von Mises statistic (dbl)
In the case of an object of class fitdists the function also returns
The Information Criterion differences (dbl)
The Information Criterion weights (dbl)
where delta
and weight
are based on aic
for censored data
and aicc
for non-censored data.
ssd_gof(x, ...) ## S3 method for class 'fitdists' ssd_gof(x, pvalue = FALSE, ...)
ssd_gof(x, ...) ## S3 method for class 'fitdists' ssd_gof(x, pvalue = FALSE, ...)
x |
The object. |
... |
Unused. |
pvalue |
A flag specifying whether to return p-values or the statistics (default) for the various tests. |
A tbl data frame of the gof statistics.
ssd_gof(fitdists)
: Goodness of Fit
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_gof(fits) ssd_gof(fits)
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_gof(fits) ssd_gof(fits)
Calculates concentration(s) with bootstrap confidence intervals that protect specified proportion(s) of species for individual or model-averaged distributions using parametric or non-parametric bootstrapping.
ssd_hc(x, ...) ## S3 method for class 'list' ssd_hc(x, percent, proportion = 0.05, ...) ## S3 method for class 'fitdists' ssd_hc( x, percent, proportion = 0.05, average = TRUE, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, multi_est = TRUE, ci_method = "weighted_samples", parametric = TRUE, delta = 9.21, samples = FALSE, save_to = NULL, control = NULL, ... ) ## S3 method for class 'fitburrlioz' ssd_hc( x, percent, proportion = 0.05, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = FALSE, samples = FALSE, save_to = NULL, ... )
ssd_hc(x, ...) ## S3 method for class 'list' ssd_hc(x, percent, proportion = 0.05, ...) ## S3 method for class 'fitdists' ssd_hc( x, percent, proportion = 0.05, average = TRUE, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, multi_est = TRUE, ci_method = "weighted_samples", parametric = TRUE, delta = 9.21, samples = FALSE, save_to = NULL, control = NULL, ... ) ## S3 method for class 'fitburrlioz' ssd_hc( x, percent, proportion = 0.05, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = FALSE, samples = FALSE, save_to = NULL, ... )
x |
The object. |
... |
Unused. |
percent |
A numeric vector of percent values to estimate hazard concentrations for. Soft-deprecated for |
proportion |
A numeric vector of proportion values to estimate hazard concentrations for. |
average |
A flag specifying whether to provide model averaged values as opposed to a value for each distribution. |
ci |
A flag specifying whether to estimate confidence intervals (by bootstrapping). |
level |
A number between 0 and 1 of the confidence level of the interval. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
multi_est |
A flag specifying whether to treat the distributions as constituting a single distribution (as opposed to taking the mean) when calculating model averaged estimates. |
ci_method |
A string specifying which method to use for estimating the bootstrap values. Possible values are "multi_free" and "multi_fixed" which treat the distributions as constituting a single distribution but differ in whether the model weights are fixed and "weighted_samples" and "weighted_arithmetic" take bootstrap samples from each distribution proportional to its weight versus calculating the weighted arithmetic means of the lower and upper confidence limits. |
parametric |
A flag specifying whether to perform parametric bootstrapping as opposed to non-parametrically resampling the original data with replacement. |
delta |
A non-negative number specifying the maximum absolute AIC difference cutoff. Distributions with an absolute AIC difference greater than delta are excluded from the calculations. |
samples |
A flag specfying whether to include a numeric vector of the bootstrap samples as a list column in the output. |
save_to |
NULL or a string specifying a directory to save where the bootstrap datasets and parameter estimates (when successfully converged) to. |
control |
A list of control parameters passed to |
Model-averaged estimates and/or confidence intervals (including standard error)
can be calculated by treating the distributions as
constituting a single mixture distribution
versus 'taking the mean'.
When calculating the model averaged estimates treating the
distributions as constituting a single mixture distribution
ensures that ssd_hc()
is the inverse of ssd_hp()
.
If treating the distributions as constituting a single mixture distribution
when calculating model average confidence intervals then
weighted
specifies whether to use the original model weights versus
re-estimating for each bootstrap sample unless 'taking the mean' in which case
weighted
specifies
whether to take bootstrap samples from each distribution proportional to
its weight (so that they sum to nboot
) versus
calculating the weighted arithmetic means of the lower
and upper confidence limits based on nboot
samples for each distribution.
Distributions with an absolute AIC difference greater than a delta of by default 7 have considerably less support (weight < 0.01) and are excluded prior to calculation of the hazard concentrations to reduce the run time.
A tibble of corresponding hazard concentrations.
ssd_hc(list)
: Hazard Concentrations for Distributional Estimates
ssd_hc(fitdists)
: Hazard Concentrations for fitdists Object
ssd_hc(fitburrlioz)
: Hazard Concentrations for fitburrlioz Object
Burnham, K.P., and Anderson, D.R. 2002. Model Selection and Multimodel Inference. Springer New York, New York, NY. doi:10.1007/b97636.
predict.fitdists()
and ssd_hp()
.
ssd_hc(ssd_match_moments()) fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_hc(fits) fit <- ssd_fit_burrlioz(ssddata::ccme_boron) ssd_hc(fit)
ssd_hc(ssd_match_moments()) fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_hc(fits) fit <- ssd_fit_burrlioz(ssddata::ccme_boron) ssd_hc(fit)
Gets hazard concentrations with confidence intervals that protect 1, 5, 10 and 20% of species using settings adopted by BC, Canada, Australia and New Zealand for official guidelines. This function can take several minutes to run with recommended 10,000 iterations.
ssd_hc_bcanz(x, nboot = 10000, min_pboot = 0.95)
ssd_hc_bcanz(x, nboot = 10000, min_pboot = 0.95)
x |
The object. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
A tibble of corresponding hazard concentrations.
Other BCANZ:
ssd_fit_bcanz()
,
ssd_hp_bcanz()
fits <- ssd_fit_bcanz(ssddata::ccme_boron) ssd_hc_bcanz(fits, nboot = 100)
fits <- ssd_fit_bcanz(ssddata::ccme_boron) ssd_hc_bcanz(fits, nboot = 100)
Deprecated for ssd_hc()
.
ssd_hc_burrlioz( x, percent, proportion = 0.05, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = FALSE )
ssd_hc_burrlioz( x, percent, proportion = 0.05, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = FALSE )
x |
The object. |
percent |
A numeric vector of percent values to estimate hazard concentrations for. Soft-deprecated for |
proportion |
A numeric vector of proportion values to estimate hazard concentrations for. |
ci |
A flag specifying whether to estimate confidence intervals (by bootstrapping). |
level |
A number between 0 and 1 of the confidence level of the interval. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
parametric |
A flag specifying whether to perform parametric bootstrapping as opposed to non-parametrically resampling the original data with replacement. |
A tibble of corresponding hazard concentrations.
Calculates proportion of species affected at specified concentration(s)
with quantile based bootstrap confidence intervals for
individual or model-averaged distributions
using parametric or non-parametric bootstrapping.
For more information see the inverse function ssd_hc()
.
ssd_hp(x, ...) ## S3 method for class 'fitdists' ssd_hp( x, conc = 1, average = TRUE, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, multi_est = TRUE, ci_method = "weighted_samples", parametric = TRUE, delta = 9.21, samples = FALSE, save_to = NULL, control = NULL, ... ) ## S3 method for class 'fitburrlioz' ssd_hp( x, conc = 1, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = FALSE, samples = FALSE, save_to = NULL, ... )
ssd_hp(x, ...) ## S3 method for class 'fitdists' ssd_hp( x, conc = 1, average = TRUE, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, multi_est = TRUE, ci_method = "weighted_samples", parametric = TRUE, delta = 9.21, samples = FALSE, save_to = NULL, control = NULL, ... ) ## S3 method for class 'fitburrlioz' ssd_hp( x, conc = 1, ci = FALSE, level = 0.95, nboot = 1000, min_pboot = 0.95, parametric = FALSE, samples = FALSE, save_to = NULL, ... )
x |
The object. |
... |
Unused. |
conc |
A numeric vector of concentrations to calculate the hazard proportions for. |
average |
A flag specifying whether to provide model averaged values as opposed to a value for each distribution. |
ci |
A flag specifying whether to estimate confidence intervals (by bootstrapping). |
level |
A number between 0 and 1 of the confidence level of the interval. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
multi_est |
A flag specifying whether to treat the distributions as constituting a single distribution (as opposed to taking the mean) when calculating model averaged estimates. |
ci_method |
A string specifying which method to use for estimating the bootstrap values. Possible values are "multi_free" and "multi_fixed" which treat the distributions as constituting a single distribution but differ in whether the model weights are fixed and "weighted_samples" and "weighted_arithmetic" take bootstrap samples from each distribution proportional to its weight versus calculating the weighted arithmetic means of the lower and upper confidence limits. |
parametric |
A flag specifying whether to perform parametric bootstrapping as opposed to non-parametrically resampling the original data with replacement. |
delta |
A non-negative number specifying the maximum absolute AIC difference cutoff. Distributions with an absolute AIC difference greater than delta are excluded from the calculations. |
samples |
A flag specfying whether to include a numeric vector of the bootstrap samples as a list column in the output. |
save_to |
NULL or a string specifying a directory to save where the bootstrap datasets and parameter estimates (when successfully converged) to. |
control |
A list of control parameters passed to |
A tibble of corresponding hazard proportions.
ssd_hp(fitdists)
: Hazard Proportions for fitdists Object
ssd_hp(fitburrlioz)
: Hazard Proportions for fitburrlioz Object
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_hp(fits, conc = 1) fit <- ssd_fit_burrlioz(ssddata::ccme_boron) ssd_hp(fit)
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_hp(fits, conc = 1) fit <- ssd_fit_burrlioz(ssddata::ccme_boron) ssd_hp(fit)
Gets proportion of species affected at specified concentration(s) using settings adopted by BC, Canada, Australia and New Zealand for official guidelines. This function can take several minutes to run with recommended 10,000 iterations.
ssd_hp_bcanz(x, conc = 1, nboot = 10000, min_pboot = 0.95)
ssd_hp_bcanz(x, conc = 1, nboot = 10000, min_pboot = 0.95)
x |
The object. |
conc |
A numeric vector of concentrations to calculate the hazard proportions for. |
nboot |
A count of the number of bootstrap samples to use to estimate the confidence limits. A value of 10,000 is recommended for official guidelines. |
min_pboot |
A number between 0 and 1 of the minimum proportion of bootstrap samples that must successfully fit (return a likelihood) to report the confidence intervals. |
A tibble of corresponding hazard concentrations.
Other BCANZ:
ssd_fit_bcanz()
,
ssd_hc_bcanz()
fits <- ssd_fit_bcanz(ssddata::ccme_boron) ssd_hp_bcanz(fits, nboot = 100)
fits <- ssd_fit_bcanz(ssddata::ccme_boron) ssd_hp_bcanz(fits, nboot = 100)
Tests if an object has censored data.
Test if a data frame is censored.
Test if a fitdists object is censored.
ssd_is_censored(x, ...) ## S3 method for class 'data.frame' ssd_is_censored(x, left = "Conc", right = left, ...) ## S3 method for class 'fitdists' ssd_is_censored(x, ...)
ssd_is_censored(x, ...) ## S3 method for class 'data.frame' ssd_is_censored(x, left = "Conc", right = left, ...) ## S3 method for class 'fitdists' ssd_is_censored(x, ...)
x |
The object. |
... |
Unused. |
left |
A string of the column in data with the concentrations. |
right |
A string of the column in data with the right concentration values. |
A flag indicating whether an object is censored.
ssd_is_censored(ssddata::ccme_boron) ssd_is_censored(data.frame(Conc = 1, right = 2), right = "right") fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_is_censored(fits)
ssd_is_censored(ssddata::ccme_boron) ssd_is_censored(data.frame(Conc = 1, right = 2), right = "right") fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_is_censored(fits)
Label numbers with significant digits and comma
ssd_label_comma(digits = 3, ..., big.mark = ",")
ssd_label_comma(digits = 3, ..., big.mark = ",")
digits |
A whole number specifying the number of significant figures. |
... |
Unused. |
big.mark |
A string specifying used between every 3 digits to separate thousands on the x-axis. |
A "labelling" function that takes a vector x and
returns a character vector of length(x)
giving a label for each input value.
ggplot2::ggplot(data = ssddata::anon_e, ggplot2::aes(x = Conc / 10)) + geom_ssdpoint() + ggplot2::scale_x_log10(labels = ssd_label_comma())
ggplot2::ggplot(data = ssddata::anon_e, ggplot2::aes(x = Conc / 10)) + geom_ssdpoint() + ggplot2::scale_x_log10(labels = ssd_label_comma())
A string of markdown code indicating the licensing of the code and documentation
ssd_licensing_md()
ssd_licensing_md()
ssd_licensing_md()
ssd_licensing_md()
Gets a named list of the values that produce the moment values (meanlog and sdlog) by distribution and term.
ssd_match_moments( dists = ssd_dists_bcanz(), meanlog = 1, sdlog = 1, nsim = 1e+05 )
ssd_match_moments( dists = ssd_dists_bcanz(), meanlog = 1, sdlog = 1, nsim = 1e+05 )
dists |
A character vector of the distribution names. |
meanlog |
The mean on the log scale. |
sdlog |
The standard deviation on the log scale. |
nsim |
A positive whole number of the number of simulations to generate. |
a named list of the values that produce the moment values by distribution and term.
estimates.fitdists()
, ssd_hc()
and ssd_plot_cdf()
moments <- ssd_match_moments() print(moments) ssd_hc(moments) ssd_plot_cdf(moments)
moments <- ssd_match_moments() print(moments) ssd_hc(moments) ssd_plot_cdf(moments)
Calculate Minimum Proportion in Mixture Models
ssd_min_pmix(n)
ssd_min_pmix(n)
n |
positive number of observations. |
A number between 0 and 0.5 of the minimum proportion in mixture models.
ssd_min_pmix(6) ssd_min_pmix(50)
ssd_min_pmix(6) ssd_min_pmix(50)
Color-blind Palette for SSD Plots
ssd_pal()
ssd_pal()
A character vector of a color blind palette with 8 colors.
Other ggplot:
geom_hcintersect()
,
geom_ssdpoint()
,
geom_ssdsegment()
,
geom_xribbon()
,
scale_colour_ssd()
ssd_pal()
ssd_pal()
Cumulative Distribution Function
ssd_pburrIII3( q, shape1 = 1, shape2 = 1, scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_pgamma(q, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_pgompertz(q, location = 1, shape = 1, lower.tail = TRUE, log.p = FALSE) ssd_pinvpareto(q, shape = 3, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_plgumbel( q, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE ) ssd_pllogis_llogis( q, locationlog1 = 0, scalelog1 = 1, locationlog2 = 1, scalelog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_pllogis(q, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE) ssd_plnorm_lnorm( q, meanlog1 = 0, sdlog1 = 1, meanlog2 = 1, sdlog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_plnorm(q, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) ssd_pmulti( q, burrIII3.weight = 0, burrIII3.shape1 = 1, burrIII3.shape2 = 1, burrIII3.scale = 1, gamma.weight = 0, gamma.shape = 1, gamma.scale = 1, gompertz.weight = 0, gompertz.location = 1, gompertz.shape = 1, invpareto.weight = 0, invpareto.shape = 3, invpareto.scale = 1, lgumbel.weight = 0, lgumbel.locationlog = 0, lgumbel.scalelog = 1, llogis.weight = 0, llogis.locationlog = 0, llogis.scalelog = 1, llogis_llogis.weight = 0, llogis_llogis.locationlog1 = 0, llogis_llogis.scalelog1 = 1, llogis_llogis.locationlog2 = 1, llogis_llogis.scalelog2 = 1, llogis_llogis.pmix = 0.5, lnorm.weight = 0, lnorm.meanlog = 0, lnorm.sdlog = 1, lnorm_lnorm.weight = 0, lnorm_lnorm.meanlog1 = 0, lnorm_lnorm.sdlog1 = 1, lnorm_lnorm.meanlog2 = 1, lnorm_lnorm.sdlog2 = 1, lnorm_lnorm.pmix = 0.5, weibull.weight = 0, weibull.shape = 1, weibull.scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_pmulti_fitdists(q, fitdists, lower.tail = TRUE, log.p = FALSE) ssd_pweibull(q, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)
ssd_pburrIII3( q, shape1 = 1, shape2 = 1, scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_pgamma(q, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_pgompertz(q, location = 1, shape = 1, lower.tail = TRUE, log.p = FALSE) ssd_pinvpareto(q, shape = 3, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_plgumbel( q, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE ) ssd_pllogis_llogis( q, locationlog1 = 0, scalelog1 = 1, locationlog2 = 1, scalelog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_pllogis(q, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE) ssd_plnorm_lnorm( q, meanlog1 = 0, sdlog1 = 1, meanlog2 = 1, sdlog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_plnorm(q, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) ssd_pmulti( q, burrIII3.weight = 0, burrIII3.shape1 = 1, burrIII3.shape2 = 1, burrIII3.scale = 1, gamma.weight = 0, gamma.shape = 1, gamma.scale = 1, gompertz.weight = 0, gompertz.location = 1, gompertz.shape = 1, invpareto.weight = 0, invpareto.shape = 3, invpareto.scale = 1, lgumbel.weight = 0, lgumbel.locationlog = 0, lgumbel.scalelog = 1, llogis.weight = 0, llogis.locationlog = 0, llogis.scalelog = 1, llogis_llogis.weight = 0, llogis_llogis.locationlog1 = 0, llogis_llogis.scalelog1 = 1, llogis_llogis.locationlog2 = 1, llogis_llogis.scalelog2 = 1, llogis_llogis.pmix = 0.5, lnorm.weight = 0, lnorm.meanlog = 0, lnorm.sdlog = 1, lnorm_lnorm.weight = 0, lnorm_lnorm.meanlog1 = 0, lnorm_lnorm.sdlog1 = 1, lnorm_lnorm.meanlog2 = 1, lnorm_lnorm.sdlog2 = 1, lnorm_lnorm.pmix = 0.5, weibull.weight = 0, weibull.shape = 1, weibull.scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_pmulti_fitdists(q, fitdists, lower.tail = TRUE, log.p = FALSE) ssd_pweibull(q, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)
q |
vector of quantiles. |
shape1 |
shape1 parameter. |
shape2 |
shape2 parameter. |
scale |
scale parameter. |
lower.tail |
logical; if TRUE (default), probabilities are |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
shape |
shape parameter. |
location |
location parameter. |
locationlog |
location on the log scale parameter. |
scalelog |
scale on log scale parameter. |
locationlog1 |
locationlog1 parameter. |
scalelog1 |
scalelog1 parameter. |
locationlog2 |
locationlog2 parameter. |
scalelog2 |
scalelog2 parameter. |
pmix |
Proportion mixture parameter. |
meanlog1 |
mean on log scale parameter. |
sdlog1 |
standard deviation on log scale parameter. |
meanlog2 |
mean on log scale parameter. |
sdlog2 |
standard deviation on log scale parameter. |
meanlog |
mean on log scale parameter. |
sdlog |
standard deviation on log scale parameter. |
burrIII3.weight |
weight parameter for the Burr III distribution. |
burrIII3.shape1 |
shape1 parameter for the Burr III distribution. |
burrIII3.shape2 |
shape2 parameter for the Burr III distribution. |
burrIII3.scale |
scale parameter for the Burr III distribution. |
gamma.weight |
weight parameter for the gamma distribution. |
gamma.shape |
shape parameter for the gamma distribution. |
gamma.scale |
scale parameter for the gamma distribution. |
gompertz.weight |
weight parameter for the Gompertz distribution. |
gompertz.location |
location parameter for the Gompertz distribution. |
gompertz.shape |
shape parameter for the Gompertz distribution. |
invpareto.weight |
weight parameter for the inverse Pareto distribution. |
invpareto.shape |
shape parameter for the inverse Pareto distribution. |
invpareto.scale |
scale parameter for the inverse Pareto distribution. |
lgumbel.weight |
weight parameter for the log-Gumbel distribution. |
lgumbel.locationlog |
location parameter for the log-Gumbel distribution. |
lgumbel.scalelog |
scale parameter for the log-Gumbel distribution. |
llogis.weight |
weight parameter for the log-logistic distribution. |
llogis.locationlog |
location parameter for the log-logistic distribution. |
llogis.scalelog |
scale parameter for the log-logistic distribution. |
llogis_llogis.weight |
weight parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog1 |
locationlog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog1 |
scalelog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog2 |
locationlog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog2 |
scalelog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.pmix |
pmix parameter for the log-logistic log-logistic mixture distribution. |
lnorm.weight |
weight parameter for the log-normal distribution. |
lnorm.meanlog |
meanlog parameter for the log-normal distribution. |
lnorm.sdlog |
sdlog parameter for the log-normal distribution. |
lnorm_lnorm.weight |
weight parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog1 |
meanlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog1 |
sdlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog2 |
meanlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog2 |
sdlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.pmix |
pmix parameter for the log-normal log-normal mixture distribution. |
weibull.weight |
weight parameter for the Weibull distribution. |
weibull.shape |
shape parameter for the Weibull distribution. |
weibull.scale |
scale parameter for the Weibull distribution. |
fitdists |
An object of class fitdists. |
ssd_pburrIII3()
: Cumulative Distribution Function for BurrIII Distribution
ssd_pgamma()
: Cumulative Distribution Function for Gamma Distribution
ssd_pgompertz()
: Cumulative Distribution Function for Gompertz Distribution
ssd_pinvpareto()
: Cumulative Distribution Function for Inverse Pareto Distribution
ssd_plgumbel()
: Cumulative Distribution Function for Log-Gumbel Distribution
ssd_pllogis_llogis()
: Cumulative Distribution Function for Log-Logistic/Log-Logistic Mixture Distribution
ssd_pllogis()
: Cumulative Distribution Function for Log-Logistic Distribution
ssd_plnorm_lnorm()
: Cumulative Distribution Function for Log-Normal/Log-Normal Mixture Distribution
ssd_plnorm()
: Cumulative Distribution Function for Log-Normal Distribution
ssd_pmulti()
: Cumulative Distribution Function for Multiple Distributions
ssd_pmulti_fitdists()
: Cumulative Distribution Function for Multiple Distributions
ssd_pweibull()
: Cumulative Distribution Function for Weibull Distribution
ssd_pburrIII3(1) ssd_pgamma(1) ssd_pgompertz(1) ssd_pinvpareto(1) ssd_plgumbel(1) ssd_pllogis_llogis(1) ssd_pllogis(1) ssd_plnorm_lnorm(1) ssd_plnorm(1) # multi ssd_pmulti(1, gamma.weight = 0.5, lnorm.weight = 0.5) # multi fitdists fit <- ssd_fit_dists(ssddata::ccme_boron) ssd_pmulti_fitdists(1, fit) ssd_pweibull(1)
ssd_pburrIII3(1) ssd_pgamma(1) ssd_pgompertz(1) ssd_pinvpareto(1) ssd_plgumbel(1) ssd_pllogis_llogis(1) ssd_pllogis(1) ssd_plnorm_lnorm(1) ssd_plnorm(1) # multi ssd_pmulti(1, gamma.weight = 0.5, lnorm.weight = 0.5) # multi fitdists fit <- ssd_fit_dists(ssddata::ccme_boron) ssd_pmulti_fitdists(1, fit) ssd_pweibull(1)
Plots species sensitivity data and distributions.
ssd_plot( data, pred, left = "Conc", right = left, ..., label = NULL, shape = NULL, color = NULL, size = 2.5, linetype = NULL, linecolor = NULL, xlab = "Concentration", ylab = "Species Affected", ci = TRUE, ribbon = TRUE, hc = 0.05, shift_x = 3, add_x = 0, bounds = c(left = 1, right = 1), big.mark = ",", suffix = "%", trans = "log10", xbreaks = waiver() )
ssd_plot( data, pred, left = "Conc", right = left, ..., label = NULL, shape = NULL, color = NULL, size = 2.5, linetype = NULL, linecolor = NULL, xlab = "Concentration", ylab = "Species Affected", ci = TRUE, ribbon = TRUE, hc = 0.05, shift_x = 3, add_x = 0, bounds = c(left = 1, right = 1), big.mark = ",", suffix = "%", trans = "log10", xbreaks = waiver() )
data |
A data frame. |
pred |
A data frame of the predictions. |
left |
A string of the column in data with the concentrations. |
right |
A string of the column in data with the right concentration values. |
... |
Unused. |
label |
A string of the column in data with the labels. |
shape |
A string of the column in data for the shape aesthetic. |
color |
A string of the column in data for the color aesthetic. |
size |
A number for the size of the labels. |
linetype |
A string of the column in pred to use for the linetype. |
linecolor |
A string of the column in pred to use for the line color. |
xlab |
A string of the x-axis label. |
ylab |
A string of the x-axis label. |
ci |
A flag specifying whether to estimate confidence intervals (by bootstrapping). |
ribbon |
A flag indicating whether to plot the confidence interval as a grey ribbon as opposed to green solid lines. |
hc |
A value between 0 and 1 indicating the proportion hazard concentration (or NULL). |
shift_x |
The value to multiply the label x values by (after adding |
add_x |
The value to add to the label x values (before multiplying by |
bounds |
A named non-negative numeric vector of the left and right bounds for uncensored missing (0 and Inf) data in terms of the orders of magnitude relative to the extremes for non-missing values. |
big.mark |
A string specifying used between every 3 digits to separate thousands on the x-axis. |
suffix |
Additional text to display after the number on the y-axis. |
trans |
A string which transformation to use by default |
xbreaks |
The x-axis breaks as one of:
|
ssd_plot_cdf()
and geom_ssdpoint()
ssd_plot(ssddata::ccme_boron, boron_pred, label = "Species", shape = "Group")
ssd_plot(ssddata::ccme_boron, boron_pred, label = "Species", shape = "Group")
Generic function to plots the cumulative distribution function (CDF).
ssd_plot_cdf(x, ...) ## S3 method for class 'fitdists' ssd_plot_cdf(x, average = FALSE, delta = 9.21, ...) ## S3 method for class 'list' ssd_plot_cdf(x, ...)
ssd_plot_cdf(x, ...) ## S3 method for class 'fitdists' ssd_plot_cdf(x, average = FALSE, delta = 9.21, ...) ## S3 method for class 'list' ssd_plot_cdf(x, ...)
x |
The object. |
... |
Additional arguments passed to |
average |
A flag specifying whether to provide model averaged values as opposed to a value for each distribution or if NA provides model averaged and individual values. |
delta |
A non-negative number specifying the maximum absolute AIC difference cutoff. Distributions with an absolute AIC difference greater than delta are excluded from the calculations. |
ssd_plot_cdf(fitdists)
: Plot CDF for fitdists object
ssd_plot_cdf(list)
: Plot CDF for named list of distributional parameter values
estimates.fitdists()
and ssd_match_moments()
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_plot_cdf(fits) ssd_plot_cdf(fits, average = NA) ssd_plot_cdf(list( llogis = c(locationlog = 2, scalelog = 1), lnorm = c(meanlog = 2, sdlog = 2) ))
fits <- ssd_fit_dists(ssddata::ccme_boron) ssd_plot_cdf(fits) ssd_plot_cdf(fits, average = NA) ssd_plot_cdf(list( llogis = c(locationlog = 2, scalelog = 1), lnorm = c(meanlog = 2, sdlog = 2) ))
Plots a Cullen and Frey graph of the skewness and kurtosis for non-censored data.
ssd_plot_cf(data, left = "Conc")
ssd_plot_cf(data, left = "Conc")
data |
A data frame. |
left |
A string of the column in data with the concentrations. |
Soft deprecated for direct call to fitdistrplus::descdist()
.
Plots species sensitivity data.
ssd_plot_data( data, left = "Conc", right = left, ..., label = NULL, shape = NULL, color = NULL, size = 2.5, xlab = "Concentration", ylab = "Species Affected", shift_x = 3, add_x = 0, big.mark = ",", suffix = "%", bounds = c(left = 1, right = 1), trans = "log10", xbreaks = waiver() )
ssd_plot_data( data, left = "Conc", right = left, ..., label = NULL, shape = NULL, color = NULL, size = 2.5, xlab = "Concentration", ylab = "Species Affected", shift_x = 3, add_x = 0, big.mark = ",", suffix = "%", bounds = c(left = 1, right = 1), trans = "log10", xbreaks = waiver() )
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. |
... |
Unused. |
label |
A string of the column in data with the labels. |
shape |
A string of the column in data for the shape aesthetic. |
color |
A string of the column in data for the color aesthetic. |
size |
A number for the size of the labels. |
xlab |
A string of the x-axis label. |
ylab |
A string of the x-axis label. |
shift_x |
The value to multiply the label x values by (after adding |
add_x |
The value to add to the label x values (before multiplying by |
big.mark |
A string specifying used between every 3 digits to separate thousands on the x-axis. |
suffix |
Additional text to display after the number on the y-axis. |
bounds |
A named non-negative numeric vector of the left and right bounds for uncensored missing (0 and Inf) data in terms of the orders of magnitude relative to the extremes for non-missing values. |
trans |
A string which transformation to use by default |
xbreaks |
The x-axis breaks as one of:
|
ssd_plot()
and geom_ssdpoint()
ssd_plot_data(ssddata::ccme_boron, label = "Species", shape = "Group")
ssd_plot_data(ssddata::ccme_boron, label = "Species", shape = "Group")
Quantile Function
ssd_qburrIII3( p, shape1 = 1, shape2 = 1, scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_qgamma(p, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_qgompertz(p, location = 1, shape = 1, lower.tail = TRUE, log.p = FALSE) ssd_qinvpareto(p, shape = 3, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_qlgumbel( p, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE ) ssd_qllogis_llogis( p, locationlog1 = 0, scalelog1 = 1, locationlog2 = 1, scalelog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_qllogis(p, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE) ssd_qlnorm_lnorm( p, meanlog1 = 0, sdlog1 = 1, meanlog2 = 1, sdlog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_qlnorm(p, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) ssd_qmulti( p, burrIII3.weight = 0, burrIII3.shape1 = 1, burrIII3.shape2 = 1, burrIII3.scale = 1, gamma.weight = 0, gamma.shape = 1, gamma.scale = 1, gompertz.weight = 0, gompertz.location = 1, gompertz.shape = 1, invpareto.weight = 0, invpareto.shape = 3, invpareto.scale = 1, lgumbel.weight = 0, lgumbel.locationlog = 0, lgumbel.scalelog = 1, llogis.weight = 0, llogis.locationlog = 0, llogis.scalelog = 1, llogis_llogis.weight = 0, llogis_llogis.locationlog1 = 0, llogis_llogis.scalelog1 = 1, llogis_llogis.locationlog2 = 1, llogis_llogis.scalelog2 = 1, llogis_llogis.pmix = 0.5, lnorm.weight = 0, lnorm.meanlog = 0, lnorm.sdlog = 1, lnorm_lnorm.weight = 0, lnorm_lnorm.meanlog1 = 0, lnorm_lnorm.sdlog1 = 1, lnorm_lnorm.meanlog2 = 1, lnorm_lnorm.sdlog2 = 1, lnorm_lnorm.pmix = 0.5, weibull.weight = 0, weibull.shape = 1, weibull.scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_qmulti_fitdists(p, fitdists, lower.tail = TRUE, log.p = FALSE) ssd_qweibull(p, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)
ssd_qburrIII3( p, shape1 = 1, shape2 = 1, scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_qgamma(p, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_qgompertz(p, location = 1, shape = 1, lower.tail = TRUE, log.p = FALSE) ssd_qinvpareto(p, shape = 3, scale = 1, lower.tail = TRUE, log.p = FALSE) ssd_qlgumbel( p, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE ) ssd_qllogis_llogis( p, locationlog1 = 0, scalelog1 = 1, locationlog2 = 1, scalelog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_qllogis(p, locationlog = 0, scalelog = 1, lower.tail = TRUE, log.p = FALSE) ssd_qlnorm_lnorm( p, meanlog1 = 0, sdlog1 = 1, meanlog2 = 1, sdlog2 = 1, pmix = 0.5, lower.tail = TRUE, log.p = FALSE ) ssd_qlnorm(p, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) ssd_qmulti( p, burrIII3.weight = 0, burrIII3.shape1 = 1, burrIII3.shape2 = 1, burrIII3.scale = 1, gamma.weight = 0, gamma.shape = 1, gamma.scale = 1, gompertz.weight = 0, gompertz.location = 1, gompertz.shape = 1, invpareto.weight = 0, invpareto.shape = 3, invpareto.scale = 1, lgumbel.weight = 0, lgumbel.locationlog = 0, lgumbel.scalelog = 1, llogis.weight = 0, llogis.locationlog = 0, llogis.scalelog = 1, llogis_llogis.weight = 0, llogis_llogis.locationlog1 = 0, llogis_llogis.scalelog1 = 1, llogis_llogis.locationlog2 = 1, llogis_llogis.scalelog2 = 1, llogis_llogis.pmix = 0.5, lnorm.weight = 0, lnorm.meanlog = 0, lnorm.sdlog = 1, lnorm_lnorm.weight = 0, lnorm_lnorm.meanlog1 = 0, lnorm_lnorm.sdlog1 = 1, lnorm_lnorm.meanlog2 = 1, lnorm_lnorm.sdlog2 = 1, lnorm_lnorm.pmix = 0.5, weibull.weight = 0, weibull.shape = 1, weibull.scale = 1, lower.tail = TRUE, log.p = FALSE ) ssd_qmulti_fitdists(p, fitdists, lower.tail = TRUE, log.p = FALSE) ssd_qweibull(p, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)
p |
vector of probabilities. |
shape1 |
shape1 parameter. |
shape2 |
shape2 parameter. |
scale |
scale parameter. |
lower.tail |
logical; if TRUE (default), probabilities are |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
shape |
shape parameter. |
location |
location parameter. |
locationlog |
location on the log scale parameter. |
scalelog |
scale on log scale parameter. |
locationlog1 |
locationlog1 parameter. |
scalelog1 |
scalelog1 parameter. |
locationlog2 |
locationlog2 parameter. |
scalelog2 |
scalelog2 parameter. |
pmix |
Proportion mixture parameter. |
meanlog1 |
mean on log scale parameter. |
sdlog1 |
standard deviation on log scale parameter. |
meanlog2 |
mean on log scale parameter. |
sdlog2 |
standard deviation on log scale parameter. |
meanlog |
mean on log scale parameter. |
sdlog |
standard deviation on log scale parameter. |
burrIII3.weight |
weight parameter for the Burr III distribution. |
burrIII3.shape1 |
shape1 parameter for the Burr III distribution. |
burrIII3.shape2 |
shape2 parameter for the Burr III distribution. |
burrIII3.scale |
scale parameter for the Burr III distribution. |
gamma.weight |
weight parameter for the gamma distribution. |
gamma.shape |
shape parameter for the gamma distribution. |
gamma.scale |
scale parameter for the gamma distribution. |
gompertz.weight |
weight parameter for the Gompertz distribution. |
gompertz.location |
location parameter for the Gompertz distribution. |
gompertz.shape |
shape parameter for the Gompertz distribution. |
invpareto.weight |
weight parameter for the inverse Pareto distribution. |
invpareto.shape |
shape parameter for the inverse Pareto distribution. |
invpareto.scale |
scale parameter for the inverse Pareto distribution. |
lgumbel.weight |
weight parameter for the log-Gumbel distribution. |
lgumbel.locationlog |
location parameter for the log-Gumbel distribution. |
lgumbel.scalelog |
scale parameter for the log-Gumbel distribution. |
llogis.weight |
weight parameter for the log-logistic distribution. |
llogis.locationlog |
location parameter for the log-logistic distribution. |
llogis.scalelog |
scale parameter for the log-logistic distribution. |
llogis_llogis.weight |
weight parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog1 |
locationlog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog1 |
scalelog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog2 |
locationlog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog2 |
scalelog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.pmix |
pmix parameter for the log-logistic log-logistic mixture distribution. |
lnorm.weight |
weight parameter for the log-normal distribution. |
lnorm.meanlog |
meanlog parameter for the log-normal distribution. |
lnorm.sdlog |
sdlog parameter for the log-normal distribution. |
lnorm_lnorm.weight |
weight parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog1 |
meanlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog1 |
sdlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog2 |
meanlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog2 |
sdlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.pmix |
pmix parameter for the log-normal log-normal mixture distribution. |
weibull.weight |
weight parameter for the Weibull distribution. |
weibull.shape |
shape parameter for the Weibull distribution. |
weibull.scale |
scale parameter for the Weibull distribution. |
fitdists |
An object of class fitdists. |
ssd_qburrIII3()
: Quantile Function for BurrIII Distribution
ssd_qgamma()
: Quantile Function for Gamma Distribution
ssd_qgompertz()
: Quantile Function for Gompertz Distribution
ssd_qinvpareto()
: Quantile Function for Inverse Pareto Distribution
ssd_qlgumbel()
: Quantile Function for Log-Gumbel Distribution
ssd_qllogis_llogis()
: Cumulative Distribution Function for Log-Logistic/Log-Logistic Mixture Distribution
ssd_qllogis()
: Cumulative Distribution Function for Log-Logistic Distribution
ssd_qlnorm_lnorm()
: Cumulative Distribution Function for Log-Normal/Log-Normal Mixture Distribution
ssd_qlnorm()
: Cumulative Distribution Function for Log-Normal Distribution
ssd_qmulti()
: Quantile Function for Multiple Distributions
ssd_qmulti_fitdists()
: Quantile Function for Multiple Distributions
ssd_qweibull()
: Cumulative Distribution Function for Weibull Distribution
ssd_qburrIII3(0.5) ssd_qgamma(0.5) ssd_qgompertz(0.5) ssd_qinvpareto(0.5) ssd_qlgumbel(0.5) ssd_qllogis_llogis(0.5) ssd_qllogis(0.5) ssd_qlnorm_lnorm(0.5) ssd_qlnorm(0.5) # multi ssd_qmulti(0.5, gamma.weight = 0.5, lnorm.weight = 0.5) # multi fitdists fit <- ssd_fit_dists(ssddata::ccme_boron) ssd_qmulti_fitdists(0.5, fit) ssd_qweibull(0.5)
ssd_qburrIII3(0.5) ssd_qgamma(0.5) ssd_qgompertz(0.5) ssd_qinvpareto(0.5) ssd_qlgumbel(0.5) ssd_qllogis_llogis(0.5) ssd_qllogis(0.5) ssd_qlnorm_lnorm(0.5) ssd_qlnorm(0.5) # multi ssd_qmulti(0.5, gamma.weight = 0.5, lnorm.weight = 0.5) # multi fitdists fit <- ssd_fit_dists(ssddata::ccme_boron) ssd_qmulti_fitdists(0.5, fit) ssd_qweibull(0.5)
Random Number Generation
ssd_rburrIII3(n, shape1 = 1, shape2 = 1, scale = 1, chk = TRUE) ssd_rgamma(n, shape = 1, scale = 1, chk = TRUE) ssd_rgompertz(n, location = 1, shape = 1, chk = TRUE) ssd_rinvpareto(n, shape = 3, scale = 1, chk = TRUE) ssd_rlgumbel(n, locationlog = 0, scalelog = 1, chk = TRUE) ssd_rllogis_llogis( n, locationlog1 = 0, scalelog1 = 1, locationlog2 = 1, scalelog2 = 1, pmix = 0.5, chk = TRUE ) ssd_rllogis(n, locationlog = 0, scalelog = 1, chk = TRUE) ssd_rlnorm_lnorm( n, meanlog1 = 0, sdlog1 = 1, meanlog2 = 1, sdlog2 = 1, pmix = 0.5, chk = TRUE ) ssd_rlnorm(n, meanlog = 0, sdlog = 1, chk = TRUE) ssd_rmulti( n, burrIII3.weight = 0, burrIII3.shape1 = 1, burrIII3.shape2 = 1, burrIII3.scale = 1, gamma.weight = 0, gamma.shape = 1, gamma.scale = 1, gompertz.weight = 0, gompertz.location = 1, gompertz.shape = 1, invpareto.weight = 0, invpareto.shape = 3, invpareto.scale = 1, lgumbel.weight = 0, lgumbel.locationlog = 0, lgumbel.scalelog = 1, llogis.weight = 0, llogis.locationlog = 0, llogis.scalelog = 1, llogis_llogis.weight = 0, llogis_llogis.locationlog1 = 0, llogis_llogis.scalelog1 = 1, llogis_llogis.locationlog2 = 1, llogis_llogis.scalelog2 = 1, llogis_llogis.pmix = 0.5, lnorm.weight = 0, lnorm.meanlog = 0, lnorm.sdlog = 1, lnorm_lnorm.weight = 0, lnorm_lnorm.meanlog1 = 0, lnorm_lnorm.sdlog1 = 1, lnorm_lnorm.meanlog2 = 1, lnorm_lnorm.sdlog2 = 1, lnorm_lnorm.pmix = 0.5, weibull.weight = 0, weibull.shape = 1, weibull.scale = 1, chk = TRUE ) ssd_rmulti_fitdists(n, fitdists, chk = TRUE) ssd_rweibull(n, shape = 1, scale = 1, chk = TRUE)
ssd_rburrIII3(n, shape1 = 1, shape2 = 1, scale = 1, chk = TRUE) ssd_rgamma(n, shape = 1, scale = 1, chk = TRUE) ssd_rgompertz(n, location = 1, shape = 1, chk = TRUE) ssd_rinvpareto(n, shape = 3, scale = 1, chk = TRUE) ssd_rlgumbel(n, locationlog = 0, scalelog = 1, chk = TRUE) ssd_rllogis_llogis( n, locationlog1 = 0, scalelog1 = 1, locationlog2 = 1, scalelog2 = 1, pmix = 0.5, chk = TRUE ) ssd_rllogis(n, locationlog = 0, scalelog = 1, chk = TRUE) ssd_rlnorm_lnorm( n, meanlog1 = 0, sdlog1 = 1, meanlog2 = 1, sdlog2 = 1, pmix = 0.5, chk = TRUE ) ssd_rlnorm(n, meanlog = 0, sdlog = 1, chk = TRUE) ssd_rmulti( n, burrIII3.weight = 0, burrIII3.shape1 = 1, burrIII3.shape2 = 1, burrIII3.scale = 1, gamma.weight = 0, gamma.shape = 1, gamma.scale = 1, gompertz.weight = 0, gompertz.location = 1, gompertz.shape = 1, invpareto.weight = 0, invpareto.shape = 3, invpareto.scale = 1, lgumbel.weight = 0, lgumbel.locationlog = 0, lgumbel.scalelog = 1, llogis.weight = 0, llogis.locationlog = 0, llogis.scalelog = 1, llogis_llogis.weight = 0, llogis_llogis.locationlog1 = 0, llogis_llogis.scalelog1 = 1, llogis_llogis.locationlog2 = 1, llogis_llogis.scalelog2 = 1, llogis_llogis.pmix = 0.5, lnorm.weight = 0, lnorm.meanlog = 0, lnorm.sdlog = 1, lnorm_lnorm.weight = 0, lnorm_lnorm.meanlog1 = 0, lnorm_lnorm.sdlog1 = 1, lnorm_lnorm.meanlog2 = 1, lnorm_lnorm.sdlog2 = 1, lnorm_lnorm.pmix = 0.5, weibull.weight = 0, weibull.shape = 1, weibull.scale = 1, chk = TRUE ) ssd_rmulti_fitdists(n, fitdists, chk = TRUE) ssd_rweibull(n, shape = 1, scale = 1, chk = TRUE)
n |
positive number of observations. |
shape1 |
shape1 parameter. |
shape2 |
shape2 parameter. |
scale |
scale parameter. |
chk |
A flag specifying whether to check the arguments. |
shape |
shape parameter. |
location |
location parameter. |
locationlog |
location on the log scale parameter. |
scalelog |
scale on log scale parameter. |
locationlog1 |
locationlog1 parameter. |
scalelog1 |
scalelog1 parameter. |
locationlog2 |
locationlog2 parameter. |
scalelog2 |
scalelog2 parameter. |
pmix |
Proportion mixture parameter. |
meanlog1 |
mean on log scale parameter. |
sdlog1 |
standard deviation on log scale parameter. |
meanlog2 |
mean on log scale parameter. |
sdlog2 |
standard deviation on log scale parameter. |
meanlog |
mean on log scale parameter. |
sdlog |
standard deviation on log scale parameter. |
burrIII3.weight |
weight parameter for the Burr III distribution. |
burrIII3.shape1 |
shape1 parameter for the Burr III distribution. |
burrIII3.shape2 |
shape2 parameter for the Burr III distribution. |
burrIII3.scale |
scale parameter for the Burr III distribution. |
gamma.weight |
weight parameter for the gamma distribution. |
gamma.shape |
shape parameter for the gamma distribution. |
gamma.scale |
scale parameter for the gamma distribution. |
gompertz.weight |
weight parameter for the Gompertz distribution. |
gompertz.location |
location parameter for the Gompertz distribution. |
gompertz.shape |
shape parameter for the Gompertz distribution. |
invpareto.weight |
weight parameter for the inverse Pareto distribution. |
invpareto.shape |
shape parameter for the inverse Pareto distribution. |
invpareto.scale |
scale parameter for the inverse Pareto distribution. |
lgumbel.weight |
weight parameter for the log-Gumbel distribution. |
lgumbel.locationlog |
location parameter for the log-Gumbel distribution. |
lgumbel.scalelog |
scale parameter for the log-Gumbel distribution. |
llogis.weight |
weight parameter for the log-logistic distribution. |
llogis.locationlog |
location parameter for the log-logistic distribution. |
llogis.scalelog |
scale parameter for the log-logistic distribution. |
llogis_llogis.weight |
weight parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog1 |
locationlog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog1 |
scalelog1 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.locationlog2 |
locationlog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.scalelog2 |
scalelog2 parameter for the log-logistic log-logistic mixture distribution. |
llogis_llogis.pmix |
pmix parameter for the log-logistic log-logistic mixture distribution. |
lnorm.weight |
weight parameter for the log-normal distribution. |
lnorm.meanlog |
meanlog parameter for the log-normal distribution. |
lnorm.sdlog |
sdlog parameter for the log-normal distribution. |
lnorm_lnorm.weight |
weight parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog1 |
meanlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog1 |
sdlog1 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.meanlog2 |
meanlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.sdlog2 |
sdlog2 parameter for the log-normal log-normal mixture distribution. |
lnorm_lnorm.pmix |
pmix parameter for the log-normal log-normal mixture distribution. |
weibull.weight |
weight parameter for the Weibull distribution. |
weibull.shape |
shape parameter for the Weibull distribution. |
weibull.scale |
scale parameter for the Weibull distribution. |
fitdists |
An object of class fitdists. |
ssd_rburrIII3()
: Random Generation for BurrIII Distribution
ssd_rgamma()
: Random Generation for Gamma Distribution
ssd_rgompertz()
: Random Generation for Gompertz Distribution
ssd_rinvpareto()
: Random Generation for Inverse Pareto Distribution
ssd_rlgumbel()
: Random Generation for log-Gumbel Distribution
ssd_rllogis_llogis()
: Random Generation for Log-Logistic/Log-Logistic Mixture Distribution
ssd_rllogis()
: Random Generation for Log-Logistic Distribution
ssd_rlnorm_lnorm()
: Random Generation for Log-Normal/Log-Normal Mixture Distribution
ssd_rlnorm()
: Random Generation for Log-Normal Distribution
ssd_rmulti()
: Random Generation for Multiple Distributions
ssd_rmulti_fitdists()
: Random Generation for Multiple Distributions
ssd_rweibull()
: Random Generation for Weibull Distribution
set.seed(50) hist(ssd_rburrIII3(10000), breaks = 1000) set.seed(50) hist(ssd_rgamma(10000), breaks = 1000) set.seed(50) hist(ssd_rgompertz(10000), breaks = 1000) set.seed(50) hist(ssd_rinvpareto(10000), breaks = 1000) set.seed(50) hist(ssd_rlgumbel(10000), breaks = 1000) set.seed(50) hist(ssd_rllogis_llogis(10000), breaks = 1000) set.seed(50) hist(ssd_rllogis(10000), breaks = 1000) set.seed(50) hist(ssd_rlnorm_lnorm(10000), breaks = 1000) set.seed(50) hist(ssd_rlnorm(10000), breaks = 1000) # multi set.seed(50) hist(ssd_rmulti(1000, gamma.weight = 0.5, lnorm.weight = 0.5), breaks = 100) # multi fitdists fit <- ssd_fit_dists(ssddata::ccme_boron) ssd_rmulti_fitdists(2, fit) set.seed(50) hist(ssd_rweibull(10000), breaks = 1000)
set.seed(50) hist(ssd_rburrIII3(10000), breaks = 1000) set.seed(50) hist(ssd_rgamma(10000), breaks = 1000) set.seed(50) hist(ssd_rgompertz(10000), breaks = 1000) set.seed(50) hist(ssd_rinvpareto(10000), breaks = 1000) set.seed(50) hist(ssd_rlgumbel(10000), breaks = 1000) set.seed(50) hist(ssd_rllogis_llogis(10000), breaks = 1000) set.seed(50) hist(ssd_rllogis(10000), breaks = 1000) set.seed(50) hist(ssd_rlnorm_lnorm(10000), breaks = 1000) set.seed(50) hist(ssd_rlnorm(10000), breaks = 1000) # multi set.seed(50) hist(ssd_rmulti(1000, gamma.weight = 0.5, lnorm.weight = 0.5), breaks = 100) # multi fitdists fit <- ssd_fit_dists(ssddata::ccme_boron) ssd_rmulti_fitdists(2, fit) set.seed(50) hist(ssd_rweibull(10000), breaks = 1000)
Sorts Species Sensitivity Data by empirical cumulative density (ECD).
ssd_sort_data(data, left = "Conc", right = left)
ssd_sort_data(data, left = "Conc", right = left)
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. |
Useful for sorting data before using geom_ssdpoint()
and geom_ssdsegment()
to construct plots for censored data with stat = identity
to
ensure order is the same for the various components.
data sorted by the empirical cumulative density.
ssd_sort_data(ssddata::ccme_boron)
ssd_sort_data(ssddata::ccme_boron)
Calculates the 5% Hazard Concentration for British Columbia after rescaling the data based on the log-logistic, log-normal and gamma distributions using the parametric bootstrap and AICc model averaging.
ssd_wqg_bc(data, left = "Conc")
ssd_wqg_bc(data, left = "Conc")
data |
A data frame. |
left |
A string of the column in data with the concentrations. |
Returns a tibble the model averaged 5% hazard concentration with standard errors, 95% lower and upper confidence limits and the number of bootstrap samples as well as the proportion of bootstrap samples that successfully returned a likelihood (convergence of the bootstrap sample is not required).
A tibble of the 5% hazard concentration with 95% confidence intervals.
Other wqg:
ssd_wqg_burrlioz()
## Not run: ssd_wqg_bc(ssddata::ccme_boron) ## End(Not run)
## Not run: ssd_wqg_bc(ssddata::ccme_boron) ## End(Not run)
Calculates the 5% Hazard Concentration (after rescaling the data) using the same approach as Burrlioz based on 10,000 non-parametric bootstrap samples.
ssd_wqg_burrlioz(data, left = "Conc")
ssd_wqg_burrlioz(data, left = "Conc")
data |
A data frame. |
left |
A string of the column in data with the concentrations. |
Returns a tibble the model averaged 5% hazard concentration with standard errors, 95% lower and upper confidence limits and the number of bootstrap samples as well as the proportion of bootstrap samples that successfully returned a likelihood (convergence of the bootstrap sample is not required).
A tibble of the 5% hazard concentration with 95% confidence intervals.
ssd_fit_burrlioz()
and ssd_hc_burrlioz()
Other wqg:
ssd_wqg_bc()
## Not run: ssd_wqg_burrlioz(ssddata::ccme_boron) ## End(Not run)
## Not run: ssd_wqg_burrlioz(ssddata::ccme_boron) ## End(Not run)
ggproto Classes for Plotting Species Sensitivity Data and Distributions
StatSsdpoint StatSsdsegment GeomSsdpoint GeomSsdsegment GeomHcintersect GeomXribbon
StatSsdpoint StatSsdsegment GeomSsdpoint GeomSsdsegment GeomHcintersect GeomXribbon
An object of class StatSsdpoint
(inherits from Stat
, ggproto
, gg
) of length 4.
An object of class StatSsdsegment
(inherits from Stat
, ggproto
, gg
) of length 4.
An object of class GeomSsdpoint
(inherits from GeomPoint
, Geom
, ggproto
, gg
) of length 1.
An object of class GeomSsdsegment
(inherits from GeomSegment
, Geom
, ggproto
, gg
) of length 1.
An object of class GeomHcintersect
(inherits from Geom
, ggproto
, gg
) of length 5.
An object of class GeomXribbon
(inherits from Geom
, ggproto
, gg
) of length 6.
ggplot2::ggproto()
and ssd_plot_cdf()
Uses the empirical cumulative density/distribution to visualize species sensitivity data.
stat_ssd( mapping = NULL, data = NULL, geom = "point", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
stat_ssd( mapping = NULL, data = NULL, geom = "point", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
The geometric object to use to display the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
## Not run: ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + stat_ssd() ## End(Not run)
## Not run: ggplot2::ggplot(ssddata::ccme_boron, ggplot2::aes(x = Conc)) + stat_ssd() ## End(Not run)
Select a subset of distributions from a fitdists object. The Akaike Information-theoretic Criterion differences are calculated after selecting the distributions named in select.
## S3 method for class 'fitdists' subset(x, select = names(x), delta = Inf, ...)
## S3 method for class 'fitdists' subset(x, select = names(x), delta = Inf, ...)
x |
The object. |
select |
A character vector of the distributions to select. |
delta |
A non-negative number specifying the maximum absolute AIC difference cutoff. Distributions with an absolute AIC difference greater than delta are excluded from the calculations. |
... |
Unused. |
fits <- ssd_fit_dists(ssddata::ccme_boron) subset(fits, c("gamma", "lnorm"))
fits <- ssd_fit_dists(ssddata::ccme_boron) subset(fits, c("gamma", "lnorm"))
Turns a fitdists object into a tidy tibble of the estimates (est) and standard errors (se) by the terms (term) and distributions (dist).
## S3 method for class 'fitdists' tidy(x, all = FALSE, ...)
## S3 method for class 'fitdists' tidy(x, all = FALSE, ...)
x |
The object. |
all |
A flag specifying whether to also return transformed parameters. |
... |
Unused. |
A tidy tibble of the estimates and standard errors.
Other generics:
augment.fitdists()
,
glance.fitdists()
fits <- ssd_fit_dists(ssddata::ccme_boron) tidy(fits) tidy(fits, all = TRUE)
fits <- ssd_fit_dists(ssddata::ccme_boron) tidy(fits) tidy(fits, all = TRUE)