Skip to content

Commit

Permalink
Merge pull request #235 from easystats/dev
Browse files Browse the repository at this point in the history
CRAN 0.3.0
  • Loading branch information
strengejacke authored Sep 22, 2019
2 parents 0d7cbb2 + ea24dca commit 7c874ab
Show file tree
Hide file tree
Showing 97 changed files with 1,668 additions and 1,352 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bayestestR
Type: Package
Title: Understand and Describe Bayesian Models and Posterior Distributions
Version: 0.2.5.9000
Version: 0.3.0
Authors@R: c(
person("Dominique",
"Makowski",
Expand Down
2 changes: 1 addition & 1 deletion R/ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' ci(df, method = "HDI", ci = c(.80, .89, .95))
#'
#' library(rstanarm)
#' model <- stan_glm(mpg ~ wt, data = mtcars, chains = 2, iter = 200)
#' model <- stan_glm(mpg ~ wt, data = mtcars, chains = 2, iter = 200, refresh = 0)
#' ci(model, method = "ETI", ci = c(.80, .89))
#' ci(model, method = "HDI", ci = c(.80, .89))
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#' hdi(df, ci = c(.80, .90, .95))
#'
#' library(rstanarm)
#' model <- stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200)
#' model <- stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200, refresh = 0)
#' hdi(model)
#' hdi(model, ci = c(.80, .90, .95))
#'
Expand Down
2 changes: 1 addition & 1 deletion R/mcse.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' library(bayestestR)
#' library(rstanarm)
#'
#' model <- stan_glm(mpg ~ wt + am, data = mtcars, chains = 1)
#' model <- stan_glm(mpg ~ wt + am, data = mtcars, chains = 1, refresh = 0)
#' mcse(model)
#' @importFrom insight get_parameters
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/simulate_prior.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' library(bayestestR)
#' library(rstanarm)
#'
#' model <- stan_glm(mpg ~ wt + am, data = mtcars, chains = 1)
#' model <- stan_glm(mpg ~ wt + am, data = mtcars, chains = 1, refresh = 0)
#' simulate_prior(model)
#' @export
simulate_prior <- function(model, n = 1000, ...) {
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Existing R packages allow users to easily fit a large variety of models and extr

You can reference the package and its documentation as follows:

- Makowski, Ben-Shachar, \& Lüdecke (2019). *bayestestR: Describing Effects and their Uncertainty, Existence and Significance within the Bayesian Framework*. Journal of Open Source Software, 4(40), 1541, https://doi.org/10.21105/joss.01541

- Makowski, D., Ben-Shachar, M. S., \& Lüdecke, D. (2019). *bayestestR: Describing Effects and their Uncertainty, Existence and Significance within the Bayesian Framework*. Journal of Open Source Software, 4(40), 1541. https://doi.org/10.21105/joss.01541
- Makowski, D., Ben-Shachar, M. S., Chen, S. H. A., \& Lüdecke, D. (2019). *Indices of Effect Existence and Significance in the Bayesian Framework*. *Under review*. https://doi.org/10.31234/osf.io/2zexr

## Installation

Expand Down
43 changes: 19 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,23 @@ functions to analyze and describe posterior distributions generated by a
variety of models objects, including popular modeling packages such as
**rstanarm**, **brms** or **BayesFactor**.

You can reference our work as follows:
You can reference the package and its documentation as follows:

- Makowski, Ben-Shachar, & Lüdecke (2019). *bayestestR: Describing
Effects and their Uncertainty, Existence and Significance within the
Bayesian Framework*. Journal of Open Source Software, 4(40), 1541,
<https://doi.org/10.21105/joss.01541>
- Makowski, D., Ben-Shachar, M. S., & Lüdecke, D. (2019). *bayestestR:
Describing Effects and their Uncertainty, Existence and Significance
within the Bayesian Framework*. Journal of Open Source Software,
4(40), 1541. <https://doi.org/10.21105/joss.01541>
- Makowski, D., Ben-Shachar, M. S., Chen, S. H. A., & Lüdecke, D.
(2019). *Indices of Effect Existence and Significance in the
Bayesian Framework*. *Under review*.
<https://doi.org/10.31234/osf.io/2zexr>

## Installation

Run the following:

``` r
install.packages("devtools")
devtools::install_github("easystats/bayestestR")
```

``` r
library("bayestestR")
install.packages(bayestestR)
```

## Documentation
Expand Down Expand Up @@ -92,9 +91,9 @@ cited below at once.
``` r
describe_posterior(rnorm(1000))
## Parameter Median CI CI_low CI_high pd ROPE_CI ROPE_low ROPE_high
## 1 Posterior -0.018 89 -1.6 1.7 0.51 89 -0.1 0.1
## 1 Posterior 0.039 89 -1.8 1.6 0.52 89 -0.1 0.1
## ROPE_Percentage
## 1 0.086
## 1 0.1
```

## Point-estimates
Expand All @@ -113,7 +112,7 @@ map_estimate(posterior)
## MAP = 0.40
```

![](man/figures/unnamed-chunk-6-1.png)<!-- -->
![](man/figures/unnamed-chunk-5-1.png)<!-- -->

## Uncertainty

Expand Down Expand Up @@ -156,7 +155,7 @@ eti(posterior, ci = .89)
## [0.42, 7.27]
```

![](man/figures/unnamed-chunk-8-1.png)<!-- -->
![](man/figures/unnamed-chunk-7-1.png)<!-- -->

## Null-Hypothesis Significance Testing (NHST)

Expand Down Expand Up @@ -197,7 +196,7 @@ rope(posterior, range = c(-0.1, 0.1))
## 1.11 %
```

![](man/figures/unnamed-chunk-10-1.png)<!-- -->
![](man/figures/unnamed-chunk-9-1.png)<!-- -->

### Equivalence test

Expand Down Expand Up @@ -244,12 +243,10 @@ guidelines*](https://easystats.github.io/bayestestR/articles/guidelines.html).
``` r
posterior <- distribution_normal(100, 0.4, 0.2)
p_direction(posterior)
## # Probability of Direction (pd)
##
## pd = 98.00%
```

![](man/figures/unnamed-chunk-13-1.png)<!-- -->
![](man/figures/unnamed-chunk-12-1.png)<!-- -->

### Bayes Factor

Expand Down Expand Up @@ -277,12 +274,12 @@ bayesfactor_parameters(posterior, prior, direction = "two-sided", null = 0)
## # Bayes Factor (Savage-Dickey density ratio)
##
## Bayes Factor
## 2
## 2.08
##
## * Evidence Against The Null: [0]
```

![](man/figures/unnamed-chunk-15-1.png)<!-- -->
![](man/figures/unnamed-chunk-14-1.png)<!-- -->

<sup>*The lollipops represent the density of a point-null on the prior
distribution (the blue lollipop on the dotted distribution) and on the
Expand All @@ -306,12 +303,10 @@ divided by the density at the Maximum A Posteriori (MAP).
``` r
posterior <- distribution_normal(100, 0.4, 0.2)
p_map(posterior)
## # MAP-based p-value
##
## p (MAP) = 0.193
```

![](man/figures/unnamed-chunk-17-1.png)<!-- -->
![](man/figures/unnamed-chunk-16-1.png)<!-- -->

## Utilities

Expand Down
8 changes: 3 additions & 5 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 17 additions & 9 deletions docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7c874ab

Please sign in to comment.