Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://inbo.github.io/effectclass/
Interpret effects and visualise uncertainty
https://inbo.github.io/effectclass/
effect-size fan-chart r r-package r-stats
Last synced: 3 months ago
JSON representation
Interpret effects and visualise uncertainty
- Host: GitHub
- URL: https://inbo.github.io/effectclass/
- Owner: inbo
- License: gpl-3.0
- Created: 2019-05-22T08:44:06.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-02-28T15:06:10.000Z (12 months ago)
- Last Synced: 2024-05-01T12:39:51.233Z (10 months ago)
- Topics: effect-size, fan-chart, r, r-package, r-stats
- Language: R
- Homepage: https://effectclass.netlify.com
- Size: 5.21 MB
- Stars: 3
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Citation: CITATION.cff
Awesome Lists containing this project
- awesome-ggplot2 - effectclass
README
# effectclass
[](https://www.repostatus.org/#active)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)

[](https://www.gnu.org/licenses/gpl-3.0.html)
[](https://github.com/inbo/effectclass/releases)
[](https://github.com/inbo/effectclass/actions)


[](https://app.codecov.io/gh/inbo/effectclass?branch=main)

The `effectclass` package helps interpreting effects and visualising uncertainty.
It classifies the effects by comparing a coverage interval with a reference, lower and upper threshold. The result is a 10 scale classification of the effect. You can reduced it to a 4 scale classification. `effectclass` provides `stat_effect()` and `scale_effect()` to visualise the effects as points with different shapes.
The Bank of England visualises uncertainty by using a fan plot^[Britton, E.; Fisher, P. & J. Whitley (1998). [The Inflation Report Projections: Understanding the Fan Chart](https://www.bankofengland.co.uk/-/media/boe/files/quarterly-bulletin/1998/the-inflation-report-projections-understanding-the-fan-chart). Bank of England Quarterly Bulletin. Retrieved 2019-05-22.]. Instead of displaying a single coverage interval, they recommend to display a bunch of coverage intervals with different levels of transparency.
## Installation
You can install the released version of `effectclass` from [GitHub](https://github.com/inbo/effectclass) with:
``` r
# installation requires the "remotes" package
# install.package("remotes")remotes::install_github("inbo/effectclass")
```## Example
Classifying effect for usage in a table
``` r
library(effectclass)
z <- data.frame(
effect = c("unknown\neffect", "potential\npositive\neffect",
"potential\nnegative\neffect", "no effect", "positive\neffect",
"negative\neffect", "moderate\npositive\neffect",
"moderate\nnegative\neffect", "strong\npositive\neffect",
"strong\nnegative\neffect"),
estimate = c( 0, 0, 0, 0, 1, -1, 0.5, -0.5, 1.5, -1.5),
lcl = c(-2, -0.9, -2, -0.9, 0.1, -2, 0.1, -0.9, 1.1, -2),
ucl = c( 2, 2, 0.9, 0.9, 2, -0.1, 0.9, -0.1, 2, -1.1)
)
classification(z$lcl, z$ucl, threshold = c(-1, 1), reference = 0)
```Adding a classification to a plot
``` r
library(ggplot2)
ggplot(z, aes(x = effect, y = estimate, ymin = lcl, ymax = ucl)) +
stat_effect(threshold = c(-1, 1), reference = 0, size = 3)
```Creating a fan plot
``` r
z <- data.frame(year = 1990:2019, dx = rnorm(30), s = rnorm(30, 1, 0.05))
z$index <- cumsum(z$dx)
library(ggplot2)
ggplot(z, aes(x = year, y = index, link_sd = s)) + stat_fan() + geom_line()
```