From 283556c320e3838800ac52c6e958ba9703fc14d1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 30 Sep 2023 11:20:38 +0200 Subject: [PATCH] fix --- R/effective_sample.R | 2 +- man/effective_sample.Rd | 2 ++ tests/testthat/test-describe_posterior.R | 2 +- vignettes/probability_of_direction.Rmd | 8 ++++---- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/R/effective_sample.R b/R/effective_sample.R index e72c66725..454146a26 100644 --- a/R/effective_sample.R +++ b/R/effective_sample.R @@ -15,7 +15,7 @@ #' \item Bürkner, P. C. (2017). brms: An R package for Bayesian multilevel models using Stan. Journal of Statistical Software, 80(1), 1-28 #' } #' -#' @examples +#' @examplesIf require("rstanarm") #' \donttest{ #' library(rstanarm) #' model <- suppressWarnings( diff --git a/man/effective_sample.Rd b/man/effective_sample.Rd index e98858139..d0de21129 100644 --- a/man/effective_sample.Rd +++ b/man/effective_sample.Rd @@ -53,6 +53,7 @@ This function returns the effective sample size (ESS). \strong{Effective Sample (ESS)} should be as large as possible, altough for most applications, an effective sample size greater than 1,000 is sufficient for stable estimates (Bürkner, 2017). The ESS corresponds to the number of independent samples with the same estimation power as the N autocorrelated samples. It is is a measure of \dQuote{how much independent information there is in autocorrelated chains} (\emph{Kruschke 2015, p182-3}). } \examples{ +\dontshow{if (require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ library(rstanarm) model <- suppressWarnings( @@ -60,6 +61,7 @@ model <- suppressWarnings( ) effective_sample(model) } +\dontshow{\}) # examplesIf} } \references{ \itemize{ diff --git a/tests/testthat/test-describe_posterior.R b/tests/testthat/test-describe_posterior.R index 3d5937bd9..7836bb195 100644 --- a/tests/testthat/test-describe_posterior.R +++ b/tests/testthat/test-describe_posterior.R @@ -31,7 +31,7 @@ test_that("describe_posterior", { expect_identical(dim(rez), c(1L, 19L)) expect_identical(colnames(rez), c( "Parameter", "Median", "MAD", "Mean", "SD", "MAP", "CI", "CI_low", - "CI_high", "p_map", "pd", "p_ROPE", "ps", "ROPE_CI", "ROPE_low", + "CI_high", "p_MAP", "pd", "p_ROPE", "ps", "ROPE_CI", "ROPE_low", "ROPE_high", "ROPE_Percentage", "ROPE_Equivalence", "log_BF" )) diff --git a/vignettes/probability_of_direction.Rmd b/vignettes/probability_of_direction.Rmd index c17d8f20c..ef04fbbc3 100644 --- a/vignettes/probability_of_direction.Rmd +++ b/vignettes/probability_of_direction.Rmd @@ -238,10 +238,10 @@ for (i in 1:25) { data.frame( "sample_size" = sample_size, "true" = true_pd, - "direct" = pd(subsample) - true_pd, - "kernel" = pd(subsample, method = "kernel") - true_pd, - "logspline" = pd(subsample, method = "logspline") - true_pd, - "KernSmooth" = pd(subsample, method = "KernSmooth") - true_pd + "direct" = as.numeric(pd(subsample)) - true_pd, + "kernel" = as.numeric(pd(subsample, method = "kernel")) - true_pd, + "logspline" = as.numeric(pd(subsample, method = "logspline")) - true_pd, + "KernSmooth" = as.numeric(pd(subsample, method = "KernSmooth")) - true_pd ) ) }