Releases: bcgov/ssdtools
ssdtools 2.4.0
Features
- Added right censoring for all distributions (by @eduardszoecs).
- Added
rescale = "odds"option tossd_fit_dists()to allow fitting to dilution data includingodds_max = 0.999argument to handle values of 1.
Functions
- Added
ssd_ci_methods()andssd_est_methods()to get character vector of methods. - Added
ssd_at_boundary()andssd_computable(). - Added class and attribute preserving
[[and[operators.
Arguments
- Added
strict = TRUEargument tosubset()to allow subsetting when distributions missing (withstrict = FALSE).
Output Columns
- Added column
"dists"tossd_hc(),ssd_hp()andpredict()which is a list of the distributions. - Added
"est_method"and"ci_method"columns to tibble output byssd_hc(),ssd_hp()andpredict(). - Added
"level"column to tibble output byssd_hc(),ssd_hp()andpredict(). - Added
"at_bound"and"computable"columns to tibble output byssd_gof(). - Renamed
"method"column to"boot_method"in tibble output byssd_hc(),ssd_hp()andpredict(). ssd_hc(),ssd_hp()andpredict()now only return missing values forse,lclanduclwhennboot = 0.
Error Checking
- Added ... and check unused to ensure matching names of subsequent arguments.
- Fixed error message when Inf weights.
ssd_fit_bcanz()now checks all dists are subset ofssd_dists_bcanz().
Modifications
- Modified method to calculate
ssd_ecd()to usestats::ppoints(). - Ensures
weighted_samplessum to nboot.
Deprecated
-
Deprecated
ssd_dists_shiny(). -
Deprecated
ties.method = "first"argument inssd_ecd(). -
Soft-deprecated
est_method = "multi"argument tomulti_est = TRUEforssd_hc(),ssd_hp()andpredict(). -
Soft-deprecated
proportion = FALSEtoproportion = TRUEargument tossd_hp()which switches output from percentages to proportions. -
Soft-deprecated
wt = FALSEforwt = TRUEargument tossd_gof()andglance()which replaces column"weight"with"wt"in output. -
Soft-deprecated
ci_method = "weighted_arithmetic"forci_method = "MACL".
ssdtools 2.2.0
- Added
ssd_label_comma_hc()function to label numbers with significant digits and comma and offset hazard concentration value if present in breaks. - Added
ssd_dists_shiny()to define distributions for use in shiny app. - For
plot_coord_scale()function:- Added
x_limits = NULLto allow setting of x-axis limits. - Added
hc_value = NULLto pass hazard concentration value. - Restricted
transargument to"identity","log10"or "log".
- Added
- For
ssd_plot()function:- Added
text_sizeargument. - Added
theme_classic = FALSEargument to switch classic theme. - Soft-deprecated
sizeargument forlabel_size.
- Added
- Turned off x-axis minor breaks for all plots (for consistency) as HC major break causing multiple minor breaks in
ssd_plot().
ssdtools v2.1.0
- Added
ssd_xxmulti_fitdists()functions to accept object of classfitdists. - Set
ssd_xxmulti(..., lnorm.weight = 0)(instead of 1) to avoid incorrect values withdo.call("ssd_xxmulti", c(..., estimates(fits))iffitsdoes not include the log-normal distribution.
ssdtools v2.0.0
ssdtools v2.0.0, which now includes David Fox and Rebecca Fisher as co-authors, is the second major release of ssdtools.
Major Changes
The following changes are major in the sense that they could alter previous hazard concentrations or break code.
Model Fitting and Averaging
Modifications
The following arguments were added to ssd_hc() and ssd_hp()
multi_est = TRUEto calculate model averaged estimates treating the distributions as constituting a single mixture distribution (previously it was effectivelyFALSE).method_ci = "weighted_samples"to specify whether to use"weighted_samples","weighted_arithmetic","multi_free"or"multi_fixed"methods to generate confidence intervals (previously it was effectively"weighted_arithmetic").
In addition the data frame returned by ssd_hc() and predict() now includes a column proportion with values between 0 and 1 as opposed to a column percentage with between 0 and 100.
Finally, with censored data confidence intervals can now only be estimated by non-parametric bootstrapping as the methods of parametrically bootstrapping censored data require review.
Minor Changes
The remaining changes are minor.
Model Fitting
Modifications
The following arguments of ssd_fit_dists() were changed to reduce the chances of the lnorm_lnorm bimodal distribution being dropped from the default set:
min_pmix = ssd_min_pmix(nrow(data))so that by defaultmin_pmixis 0.1 or3/nrow(data)if greater.at_boundary_ok = TRUE.computable = TRUE.
These changes also allowed the min_pboot = 0.95 argument to be changed from 0.80 for all bootstrapping functions.
It is worth noting that the second two changes also reduce the chances of the BurrIII distribution being dropped.
In addition rescale = TRUE now divides by the geometric mean of the minimum and maximum positive finite values as opposed to dividing by the geometric mean of the maximum finite value to improve the chances of convergence although ssd_fit_bcanz() no longer rescales by default.
Other minor modifications to the model fitting functions include
estimates.fitdists()now includes weights in returned parameters as well as anall_estimates = FALSEargument to allow parameter values for all implemented distributions to be included.delta = 7instead ofdelta = 9.21to ensure weight of included models at least 0.01.- seeds are now allocated to bootstrap samples as opposed to distributions (which results in a speed gain when there are more cores than the number of distributions).
lnormandgompertzinitial values are offset from their maximum likelihood estimates to avoid errors inoptim().
The following functions and arguments were also added:
ssd_hp_bcanz()andssd_hp.fitburrlioz()to get hazard proportions.ssd_pmulti(),ssd_qmulti()andssd_rmulti()for combined mixture distributions.ssd_exx()functions to get default parameter estimates for distributions.ssd_censor_data()to censor data.npars = c(2L, 5L)argument tossd_dists_bcanz()to specify the number of parameters.dists = ssd_dists_bcanz()tossd_fit_bcanz()to allow other packages to modify.samples = FALSEtossd_hc()andssd_hp()include bootstrap samples as list of numeric vector(s).save_to = NULLtossd_hc()andssd_hp()to specify a directory in which to save the bootstrap datasets as csv files and parameter estimates as .rds files.
Fixes
ssd_hc()andssd_hp()now return data frame withparametriccolumn.ssd_hp()now return data frame withwtcolumn.
Deprecations
The following functions and arguments were deprecated:
ssd_wqg_bc()andssd_wqg_burrlioz()were deprecated.percent = 5inssd_hc()andpredict()was soft-deprecated forproportion = 0.05.is_censored()is now defunct.
Plotting
Perhaps the biggest plotting change is that ssd_plot_cdf() now plots the average SSD together with the individual distributions if average = NA.
In addition, the following functions and arguments were added.
scale_fill_ssd()for color-blind fill scale.ssd_label_comma()for formatting of x-axis labels.trans = "log10"andadd_x = 0tossd_plot()andssd_plot_data()to control x-axis scale.big.mark = ","for x-axis labels andsuffix = "%"for y-axis labels to all plotting functions.
and the following functions deprecated
comma_signif()was soft-deprecated.is_censored(),plot.fitdists(),ssd_plot_cf()geom_ssd()andstat_ssd()are now defunct.
Data
The following data sets were removed
ccme_dataandccme_boron(available inssddatapackage).pearson1000data set.
v1.0.3: ssdtools 1.0.3
- Replaced `size = 0.5` with `linewidth = 0.5` in `geom_hcintersect()` and `geom_xribbon()`. - Replaced `aes_string()` with `aes()` in examples (and internally). - Removed use of `tidyverse` package. - Now tests values to 12 significant digits. - Fixed description of `ssd_hp()` to be percent affected rather than percent protected.
v1.0.2: ssdtools 1.0.2
- Fixed bug that was producing estimates of 0 for lower HCx values for log-normal mixture model with rescaled data spanning many orders of magnitude.
v0.3.2
add lifecycle to wordlist
v0.3.1
cran comments
v0.2.0
update cran comments
v0.1.0
update docs