Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 30, 2023
1 parent 798efa5 commit 822ce87
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions R/bayesfactor_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
#'
#' # emmGrid objects
#' # ---------------
#' # group_diff <- pairs(emmeans(stan_model, ~group))
#' # bayesfactor_parameters(group_diff, prior = stan_model, verbose = FALSE)
#' group_diff <- pairs(emmeans(stan_model, ~group, data = sleep))
#' bayesfactor_parameters(group_diff, prior = stan_model, verbose = FALSE)
#'
#' # Or
#' # group_diff_prior <- pairs(emmeans(unupdate(stan_model), ~group))
Expand Down
2 changes: 1 addition & 1 deletion R/bayesfactor_restricted.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#' contrasts(disgust$condition) <- contr.equalprior_pairs # see vignette
#' fit_model <- rstanarm::stan_glm(score ~ condition, data = disgust, family = gaussian())
#'
#' em_condition <- emmeans::emmeans(fit_model, ~condition)
#' em_condition <- emmeans::emmeans(fit_model, ~condition, data = disgust)
#' hyps <- c("lemon < control & control < sulfur")
#'
#' bayesfactor_restricted(em_condition, prior = fit_model, hypothesis = hyps)
Expand Down
4 changes: 2 additions & 2 deletions man/bayesfactor_parameters.Rd

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

2 changes: 1 addition & 1 deletion man/bayesfactor_restricted.Rd

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

10 changes: 9 additions & 1 deletion vignettes/bayes_factors.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -969,14 +969,22 @@ and the difference between them:
set.seed(1)
```

```{r}
```{r eval=FALSE}
library(emmeans)
(group_diff <- emmeans(model, pairwise ~ group, data = sleep))
# pass the original model via prior
bayesfactor_parameters(group_diff, prior = model)
```
```{r echo=FALSE, message=FALSE, warning=FALSE}
library(emmeans)
suppressWarnings((group_diff <- emmeans(model, pairwise ~ group, data = sleep)))
# pass the original model via prior
suppressWarnings(bayesfactor_parameters(group_diff, prior = model))
```

That is strong evidence for the mean of group 1 being 0, and for group 2 for not
being 0, but hardly any evidence for the difference between them being not 0.
Expand Down

0 comments on commit 822ce87

Please sign in to comment.