Skip to content

Commit f1ffa8c

Browse files
committed
update readme
1 parent ee2e1a2 commit f1ffa8c

File tree

4 files changed

+57
-35
lines changed

4 files changed

+57
-35
lines changed

README.Rmd

+8-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ library(performance)
2626
```
2727

2828
[![DOI](https://joss.theoj.org/papers/10.21105/joss.03139/status.svg)](https://doi.org/10.21105/joss.03139)
29-
[![downloads](http://cranlogs.r-pkg.org/badges/performance)](https://cran.r-project.org/package=performance) [![total](https://cranlogs.r-pkg.org/badges/grand-total/performance)](https://cranlogs.r-pkg.org/)
29+
[![downloads](https://cranlogs.r-pkg.org/badges/performance)](https://cran.r-project.org/package=performance) [![total](https://cranlogs.r-pkg.org/badges/grand-total/performance)](https://cranlogs.r-pkg.org/)
3030

3131
***Test if your model is a good model!***
3232

@@ -36,7 +36,7 @@ The primary goal of the **performance** package is to fill this gap and to provi
3636

3737
## Installation
3838

39-
[![CRAN](http://www.r-pkg.org/badges/version/performance)](https://cran.r-project.org/package=performance) [![performance status badge](https://easystats.r-universe.dev/badges/performance)](https://easystats.r-universe.dev) [![R check](https://github.com/easystats/performance/workflows/R-CMD-check/badge.svg?branch=main)](https://github.com/easystats/performance/actions)
39+
[![CRAN](https://www.r-pkg.org/badges/version/performance)](https://cran.r-project.org/package=performance) [![performance status badge](https://easystats.r-universe.dev/badges/performance)](https://easystats.r-universe.dev) [![codecov](https://codecov.io/gh/easystats/performance/branch/main/graph/badge.svg)](https://app.codecov.io/gh/easystats/performance)
4040

4141
The *performance* package is available on CRAN, while its latest development version is available on R-universe (from _rOpenSci_).
4242

@@ -53,7 +53,7 @@ library("performance")
5353

5454
> **Tip**
5555
>
56-
> Instead of `library(performance)`, use `library(easystats)`. This will make all features of the easystats-ecosystem available.
56+
> Instead of `library(performance)`, use `library(easystats)`. This will make all features of the easystats-ecosystem available.
5757
>
5858
> To stay updated, use `easystats::install_latest()`.
5959
@@ -67,6 +67,11 @@ citation("performance")
6767

6868
## Documentation
6969

70+
[![Documentation](https://img.shields.io/badge/documentation-performance-orange.svg?colorB=E91E63)](https://easystats.github.io/performance/)
71+
[![Blog](https://img.shields.io/badge/blog-easystats-orange.svg?colorB=FF9800)](https://easystats.github.io/blog/posts/)
72+
[![Features](https://img.shields.io/badge/features-performance-orange.svg?colorB=2196F3)](https://easystats.github.io/performance/reference/index.html)
73+
74+
7075
There is a nice introduction into the package on [youtube](https://www.youtube.com/watch?v=EPIxQ5i5oxs).
7176

7277
## The *performance* workflow

README.md

+49-32
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# performance <img src='man/figures/logo.png' align="right" height="139" />
33

44
[![DOI](https://joss.theoj.org/papers/10.21105/joss.03139/status.svg)](https://doi.org/10.21105/joss.03139)
5-
[![downloads](http://cranlogs.r-pkg.org/badges/performance)](https://cran.r-project.org/package=performance)
5+
[![downloads](https://cranlogs.r-pkg.org/badges/performance)](https://cran.r-project.org/package=performance)
66
[![total](https://cranlogs.r-pkg.org/badges/grand-total/performance)](https://cranlogs.r-pkg.org/)
77

88
***Test if your model is a good model!***
@@ -23,18 +23,17 @@ zero-inflation, convergence or singularity.
2323

2424
## Installation
2525

26-
[![CRAN](http://www.r-pkg.org/badges/version/performance)](https://cran.r-project.org/package=performance)
26+
[![CRAN](https://www.r-pkg.org/badges/version/performance)](https://cran.r-project.org/package=performance)
2727
[![performance status
2828
badge](https://easystats.r-universe.dev/badges/performance)](https://easystats.r-universe.dev)
29-
[![R
30-
check](https://github.com/easystats/performance/workflows/R-CMD-check/badge.svg?branch=main)](https://github.com/easystats/performance/actions)
29+
[![codecov](https://codecov.io/gh/easystats/performance/branch/main/graph/badge.svg)](https://app.codecov.io/gh/easystats/performance)
3130

3231
The *performance* package is available on CRAN, while its latest
3332
development version is available on R-universe (from *rOpenSci*).
3433

35-
| Type | Source | Command |
36-
|-------------|------------|-------------------------------------------------------------------------------|
37-
| Release | CRAN | `install.packages("performance")` |
34+
| Type | Source | Command |
35+
|----|----|----|
36+
| Release | CRAN | `install.packages("performance")` |
3837
| Development | R-universe | `install.packages("performance", repos = "https://easystats.r-universe.dev")` |
3938

4039
Once you have downloaded the package, you can then load it using:
@@ -57,13 +56,13 @@ To cite performance in publications use:
5756
``` r
5857
citation("performance")
5958
#> To cite package 'performance' in publications use:
60-
#>
59+
#>
6160
#> Lüdecke et al., (2021). performance: An R Package for Assessment, Comparison and
6261
#> Testing of Statistical Models. Journal of Open Source Software, 6(60), 3139.
6362
#> https://doi.org/10.21105/joss.03139
64-
#>
63+
#>
6564
#> A BibTeX entry for LaTeX users is
66-
#>
65+
#>
6766
#> @Article{,
6867
#> title = {{performance}: An {R} Package for Assessment, Comparison and Testing of Statistical Models},
6968
#> author = {Daniel Lüdecke and Mattan S. Ben-Shachar and Indrajeet Patil and Philip Waggoner and Dominique Makowski},
@@ -78,6 +77,10 @@ citation("performance")
7877

7978
## Documentation
8079

80+
[![Documentation](https://img.shields.io/badge/documentation-performance-orange.svg?colorB=E91E63)](https://easystats.github.io/performance/)
81+
[![Blog](https://img.shields.io/badge/blog-easystats-orange.svg?colorB=FF9800)](https://easystats.github.io/blog/posts/)
82+
[![Features](https://img.shields.io/badge/features-performance-orange.svg?colorB=2196F3)](https://easystats.github.io/performance/reference/index.html)
83+
8184
There is a nice introduction into the package on
8285
[youtube](https://www.youtube.com/watch?v=EPIxQ5i5oxs).
8386

@@ -145,15 +148,15 @@ model <- stan_glmer(
145148

146149
r2(model)
147150
#> # Bayesian R2 with Compatibility Interval
148-
#>
151+
#>
149152
#> Conditional R2: 0.954 (95% CI [0.951, 0.957])
150153
#> Marginal R2: 0.414 (95% CI [0.204, 0.644])
151154

152155
library(lme4)
153156
model <- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)
154157
r2(model)
155158
#> # R2 for Mixed Models
156-
#>
159+
#>
157160
#> Conditional R2: 0.799
158161
#> Marginal R2: 0.279
159162
```
@@ -172,7 +175,7 @@ library(lme4)
172175
model <- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)
173176
icc(model)
174177
#> # Intraclass Correlation Coefficient
175-
#>
178+
#>
176179
#> Adjusted ICC: 0.722
177180
#> Unadjusted ICC: 0.521
178181
```
@@ -188,9 +191,9 @@ model <- brm(mpg ~ wt + (1 | cyl) + (1 + wt | gear), data = mtcars)
188191
``` r
189192
icc(model)
190193
#> # Intraclass Correlation Coefficient
191-
#>
192-
#> Adjusted ICC: 0.941
193-
#> Unadjusted ICC: 0.779
194+
#>
195+
#> Adjusted ICC: 0.930
196+
#> Unadjusted ICC: 0.771
194197
```
195198

196199
### Model diagnostics
@@ -209,7 +212,7 @@ data(Salamanders)
209212
model <- glm(count ~ spp + mined, family = poisson, data = Salamanders)
210213
check_overdispersion(model)
211214
#> # Overdispersion test
212-
#>
215+
#>
213216
#> dispersion ratio = 2.946
214217
#> Pearson's Chi-Squared = 1873.710
215218
#> p-value = < 0.001
@@ -234,7 +237,7 @@ fitted model.
234237
model <- glm(count ~ spp + mined, family = poisson, data = Salamanders)
235238
check_zeroinflation(model)
236239
#> # Check for zero-inflation
237-
#>
240+
#>
238241
#> Observed zeros: 387
239242
#> Predicted zeros: 298
240243
#> Ratio: 0.77
@@ -322,7 +325,7 @@ be r-squared, AIC, BIC, RMSE, ICC or LOOIC.
322325
m1 <- lm(mpg ~ wt + cyl, data = mtcars)
323326
model_performance(m1)
324327
#> # Indices of model performance
325-
#>
328+
#>
326329
#> AIC | AICc | BIC | R2 | R2 (adj.) | RMSE | Sigma
327330
#> ---------------------------------------------------------------
328331
#> 156.010 | 157.492 | 161.873 | 0.830 | 0.819 | 2.444 | 2.568
@@ -334,7 +337,7 @@ model_performance(m1)
334337
m2 <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")
335338
model_performance(m2)
336339
#> # Indices of model performance
337-
#>
340+
#>
338341
#> AIC | AICc | BIC | Tjur's R2 | RMSE | Sigma | Log_loss | Score_log | Score_spherical | PCP
339342
#> -----------------------------------------------------------------------------------------------------
340343
#> 31.298 | 32.155 | 35.695 | 0.478 | 0.359 | 1.000 | 0.395 | -14.903 | 0.095 | 0.743
@@ -347,7 +350,7 @@ library(lme4)
347350
m3 <- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)
348351
model_performance(m3)
349352
#> # Indices of model performance
350-
#>
353+
#>
351354
#> AIC | AICc | BIC | R2 (cond.) | R2 (marg.) | ICC | RMSE | Sigma
352355
#> ----------------------------------------------------------------------------------
353356
#> 1755.628 | 1756.114 | 1774.786 | 0.799 | 0.279 | 0.722 | 23.438 | 25.592
@@ -367,13 +370,27 @@ m4 <- glm(counts ~ outcome + treatment, family = poisson())
367370

368371
compare_performance(m1, m2, m3, m4, verbose = FALSE)
369372
#> # Comparison of Model Performance Indices
370-
#>
371-
#> Name | Model | AIC (weights) | AICc (weights) | BIC (weights) | RMSE | Sigma | Score_log | Score_spherical | R2 | R2 (adj.) | Tjur's R2 | Log_loss | PCP | R2 (cond.) | R2 (marg.) | ICC | Nagelkerke's R2
372-
#> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
373-
#> m1 | lm | 156.0 (<.001) | 157.5 (<.001) | 161.9 (<.001) | 2.444 | 2.568 | | | 0.830 | 0.819 | | | | | | |
374-
#> m2 | glm | 31.3 (>.999) | 32.2 (>.999) | 35.7 (>.999) | 0.359 | 1.000 | -14.903 | 0.095 | | | 0.478 | 0.395 | 0.743 | | | |
375-
#> m3 | lmerMod | 1764.0 (<.001) | 1764.5 (<.001) | 1783.1 (<.001) | 23.438 | 25.592 | | | | | | | | 0.799 | 0.279 | 0.722 |
376-
#> m4 | glm | 56.8 (<.001) | 76.8 (<.001) | 57.7 (<.001) | 3.043 | 1.000 | -2.598 | 0.324 | | | | | | | | | 0.657
373+
#>
374+
#> Name | Model | AIC (weights) | AICc (weights) | BIC (weights) | RMSE | Sigma | Score_log
375+
#> -----------------------------------------------------------------------------------------------
376+
#> m1 | lm | 156.0 (<.001) | 157.5 (<.001) | 161.9 (<.001) | 2.444 | 2.568 |
377+
#> m2 | glm | 31.3 (>.999) | 32.2 (>.999) | 35.7 (>.999) | 0.359 | 1.000 | -14.903
378+
#> m3 | lmerMod | 1764.0 (<.001) | 1764.5 (<.001) | 1783.1 (<.001) | 23.438 | 25.592 |
379+
#> m4 | glm | 56.8 (<.001) | 76.8 (<.001) | 57.7 (<.001) | 3.043 | 1.000 | -2.598
380+
#>
381+
#> Name | Score_spherical | R2 | R2 (adj.) | Tjur's R2 | Log_loss | PCP | R2 (cond.) | R2 (marg.)
382+
#> ---------------------------------------------------------------------------------------------------
383+
#> m1 | | 0.830 | 0.819 | | | | |
384+
#> m2 | 0.095 | | | 0.478 | 0.395 | 0.743 | |
385+
#> m3 | | | | | | | 0.799 | 0.279
386+
#> m4 | 0.324 | | | | | | |
387+
#>
388+
#> Name | ICC | Nagelkerke's R2
389+
#> ------------------------------
390+
#> m1 | |
391+
#> m2 | |
392+
#> m3 | 0.722 |
393+
#> m4 | | 0.657
377394
```
378395

379396
#### General index of model performance
@@ -385,7 +402,7 @@ of model performance and sort the models from the best one to the worse.
385402
``` r
386403
compare_performance(m1, m2, m3, m4, rank = TRUE, verbose = FALSE)
387404
#> # Comparison of Model Performance Indices
388-
#>
405+
#>
389406
#> Name | Model | RMSE | Sigma | AIC weights | AICc weights | BIC weights | Performance-Score
390407
#> -----------------------------------------------------------------------------------------------
391408
#> m2 | glm | 0.359 | 1.000 | 1.000 | 1.000 | 1.000 | 100.00%
@@ -423,20 +440,20 @@ lm4 <- lm(Sepal.Length ~ Species * Sepal.Width + Petal.Length + Petal.Width, dat
423440
test_performance(lm1, lm2, lm3, lm4)
424441
#> Name | Model | BF | Omega2 | p (Omega2) | LR | p (LR)
425442
#> ------------------------------------------------------------
426-
#> lm1 | lm | | | | |
443+
#> lm1 | lm | | | | |
427444
#> lm2 | lm | > 1000 | 0.69 | < .001 | -6.25 | < .001
428445
#> lm3 | lm | > 1000 | 0.36 | < .001 | -3.44 | < .001
429446
#> lm4 | lm | > 1000 | 0.73 | < .001 | -7.77 | < .001
430447
#> Each model is compared to lm1.
431448

432449
test_bf(lm1, lm2, lm3, lm4)
433450
#> Bayes Factors for Model Comparison
434-
#>
451+
#>
435452
#> Model BF
436453
#> [lm2] Species + Petal.Length 3.45e+26
437454
#> [lm3] Species * Sepal.Width 4.69e+07
438455
#> [lm4] Species * Sepal.Width + Petal.Length + Petal.Width 7.58e+29
439-
#>
456+
#>
440457
#> * Against Denominator: [lm1] Species
441458
#> * Bayes Factor Type: BIC approximation
442459
```

man/figures/unnamed-chunk-14-1.png

-1.39 KB
Loading

man/figures/unnamed-chunk-20-1.png

3 Bytes
Loading

0 commit comments

Comments
 (0)