https://github.com/benjaminhlina/ecotox

Analysis of Ecotoxicology

https://github.com/benjaminhlina/ecotox

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: wiley.com
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary

Keywords

biology dose-response-modeling logit probit toxicology
Last synced: 5 months ago · JSON representation

Repository

Analysis of Ecotoxicology

Basic Info
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • Open Issues: 2
  • Releases: 15
Topics
biology dose-response-modeling logit probit toxicology
Created over 8 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

ecotox

R-CMD-check CRAN status Codecov test coverage <!-- badges: end -->

Overview

{ecotox} was created as a simple approach to using either a probit or logit analysis to calculate lethal concentration (LC) or time (LT) and the appropriate fiducial confidence limits desired for the selected LC or LT for ecotoxicology studies (Finney 1971; Wheeler et al. 2006; Robertson et al. 2007). The simplicity of {ecotox} comes from the syntax it implies within its functions which are similar to functions like glm() and lm(). In addition to the simplicity of the syntax, a comprehensive tibble is produced which gives the user a predicted LC or LT value for the desired level and a suite of parameters such as fiducial confidence limits, z-value, and slope. {ecotox} was built for and is published in Hlina et al. 2021.

Installation

You can install the CRAN released version of {ecotox} from CRAN with:

r install.packages("ecotox")

You can install the developer version of {ecotox} from github with:

r install.packages("devtools") devtools::install_github("benjaminhlina/ecotox")

Example

This is an example which uses the LC_probit function to calculate a LC50 and LC99 for a probit analysis:

``` r

Calculate LC50 and LC99

head(lamprey_tox)

within the dataframe used, control dose, unless produced a value

during experimentation, are removed from the dataframe,

as glm cannot handle values of infinite. Other statistical programs

make note of the control dose but do not include within analysis.

calculate LC50 and LC99 for May

m <- LCprobit((response / total) ~ log10(dose), p = c(50, 99), weights = total, data = lampreytox[lampreytox$nominaldose != 0, ], subset = c(month == "May"))

view calculated LC50 and LC99 for seasonal toxicity of a pisicide,

3-trifluoromethyl-4-nitrophenol (TFM) to lamprey in 2011

m

several new features include 1) being able to change the output length

2) you can indicate whether the x variable has been log10 transformed or

not if it has the output will take that into consideration

m2 <- LCprobit((response / total) ~ dose, p = c(50, 99), weights = total, data = lampreytox, subset = c(month == "May"), logx = FALSE, long_output = FALSE)

view calculated LC50 and LC99 for seasonal toxicity of a pisicide,

3-trifluoromethyl-4-nitrophenol (TFM) to lamprey in 2011.

m_2

`` See StackExchange post about differences in usingcbind()vs.response / total` cbind() function in R for a logistic regression.

``` r

Additionally changes have been made to allow for the user

to use cbind() method when specificying the response variable

m3 <- LCprobit(cbind(response, survive) ~ log10(dose), p = c(50, 99), data = lampreytox[lampreytox$nominal_dose != 0, ], subset = c(month == "May"))

m_3

notice that m and m3 produce the same results, however m3 will produce

a warning to ensure you have not weighted the model as it is not necessary

```

Example of using ratio_test from Wheeler et al. 2006 to determine differences in LC values:

``` r

A new function ratio_test has been added

view lamprey_tox data

head(lamprey_tox)

using glm() to detemine LC values using probit model for May and June

m <- glm((response / total) ~ log10(dose), data = lampreytox[lampreytox$nominal_dose != 0, ], subset = c(month == "May"), weights = total, family = binomial(link = "probit"))

j <- glm((response / total) ~ log10(dose), data = lampreytox[lampreytox$nominal_dose != 0, ], subset = c(month == "June"), weights = total, family = binomial(link = "probit"))

now that both May and June models have been made. use ratio_test to

compare LC50 values or whatever LC values of interest.

ratios <- ratiotest(model1 = m, model_2 = j, percentage = 50, compare = "May - June")

view ratio test results

ratios

you can also use LC* or LT* objects to create the models and use ratio test:

m1 <- LCprobit((response / total) ~ log10(dose), p = c(50, 99), weights = total, data = lampreytox[lampreytox$nominal_dose != 0, ], subset = c(month == "May"))

j1 <- LCprobit((response / total) ~ log10(dose), p = c(50, 99), weights = total, data = lampreytox[lampreytox$nominal_dose != 0, ], subset = c(month == "June"))

ratios2 <- ratiotest(model1 = m1, model2 = j1, percentage = 50, compare = "May - June", obj_type = "df")

ratios_2

```

References

  • Finney, D.J., 1971. Probit analysis. Cambridge University Press, Cambridge, England. ISBN: 052108041X

  • Wheeler, M.W., Park, R.M., and Bailey, A.J. 2006. Comparing median lethal concentration values using confidence interval overlap or ratio tests. Environ. Toxic. Chem. 25(5), 1441-1444. 10.1897/05-320R.1

  • Robertson, J.L., Savin, N.E., Russell, R.M. and Preisler, H.K., 2007. Bioassays with arthropods. CRC press. ISBN: 0849323312

  • Version 1.4.4 written by Benjamin L. Hlina, Carleton University, Ottawa, Ontario, Canada. Written in 'Programming Language R', R version 4.1.1 (2021-08-10) -- "Kick Things". Source code is available at {ecotox} or by contacting Benjamin L. Hlina at benjamin.hlina@gmail.com

Owner

  • Name: Benjamin Hlina
  • Login: benjaminhlina
  • Kind: user
  • Location: Ottawa, ON, CA
  • Company: Carleton University

PhD Candidate @ Fish Ecology and Conservation Physiology Laboratory working on understanding spatial ecology of fish

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 2
  • Pull request event: 2
  • Fork event: 1
Last Year
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 2
  • Pull request event: 2
  • Fork event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 12 minutes
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 12 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • JosiahParry (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
DESCRIPTION cran
  • R >= 3.3.0 depends
  • stats * imports
  • tibble * imports
  • data.table * suggests
  • dplyr * suggests
  • ggplot2 * suggests
  • openxlsx * suggests
  • readr * suggests
  • testthat * suggests
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/cran-checks.yaml actions
  • ricochet-rs/cran-checks/check-pkg main composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite