Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 1, 2023
1 parent 704d764 commit 7706b87
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions R/map_estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' vector, this column is missing.
#' - `MAP_Estimate`: The MAP estimate for the posterior or each model parameter.
#'
#' @examples
#' @examplesIf require("rstanarm") && require("brms")
#' \donttest{
#' library(bayestestR)
#'
Expand All @@ -28,11 +28,9 @@
#' plot(density(posterior))
#' abline(v = map_estimate(posterior), col = "red")
#'
#' library(rstanarm)
#' model <- rstanarm::stan_glm(mpg ~ wt + cyl, data = mtcars)
#' map_estimate(model)
#'
#' library(brms)
#' model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
#' map_estimate(model)
#' }
Expand Down
2 changes: 1 addition & 1 deletion R/mediation.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#' # Fit Bayesian mediation model in brms
#' f1 <- bf(job_seek ~ treat + econ_hard + sex + age)
#' f2 <- bf(depress2 ~ treat + job_seek + econ_hard + sex + age)
#' m2 <- brm(f1 + f2 + set_rescor(FALSE), data = jobs, cores = 4, refresh = 0)
#' m2 <- brm(f1 + f2 + set_rescor(FALSE), data = jobs, refresh = 0)
#'
#' # Fit Bayesian mediation model in rstanarm
#' m3 <- suppressWarnings(stan_mvmer(
Expand Down
5 changes: 2 additions & 3 deletions man/map_estimate.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/mediation.Rd

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

2 changes: 1 addition & 1 deletion vignettes/mediation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ m1 <- mediate(b1, b2, sims = 1000, treat = "treat", mediator = "job_seek")
# Fit Bayesian mediation model in brms
f1 <- bf(job_seek ~ treat + econ_hard + sex + age)
f2 <- bf(depress2 ~ treat + job_seek + econ_hard + sex + age)
m2 <- brm(f1 + f2 + set_rescor(FALSE), data = jobs, cores = 4)
m2 <- brm(f1 + f2 + set_rescor(FALSE), data = jobs, refresh = 0)
```
```{r echo=FALSE}
m2 <- insight::download_model("brms_mv_6")
Expand Down
2 changes: 1 addition & 1 deletion vignettes/probability_of_direction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ for (i in 1:25) {
the_mean <- runif(1, 0, 4)
the_sd <- abs(runif(1, 0.5, 4))
parent_distribution <- rnorm(100000, the_mean, the_sd)
true_pd <- pd(parent_distribution)
true_pd <- as.numeric(pd(parent_distribution))
for (j in 1:25) {
sample_size <- round(runif(1, 25, 5000))
Expand Down

0 comments on commit 7706b87

Please sign in to comment.