From e81ac49dc76adf66d3d93f1a1cdea31e84a29c50 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 5 Sep 2024 11:58:00 +0200 Subject: [PATCH] fix --- R/p_direction.R | 6 +++++- R/p_significance.R | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/R/p_direction.R b/R/p_direction.R index 26939d609..4030cbc85 100644 --- a/R/p_direction.R +++ b/R/p_direction.R @@ -84,7 +84,11 @@ p_direction.lm <- function(x, null = 0, ...) { # generate normal distribution based on CI range - out <- .posterior_ci(x, ci, ...) + result <- .posterior_ci(x, ci, ...) + + # copy + out <- result$out + posterior <- result$posterior # add pd out$pd <- as.numeric(bayestestR::p_direction( diff --git a/R/p_significance.R b/R/p_significance.R index 9949fd45e..17124d0fe 100644 --- a/R/p_significance.R +++ b/R/p_significance.R @@ -140,7 +140,11 @@ bayestestR::p_significance #' @export p_significance.lm <- function(x, threshold = "default", ci = 0.95, verbose = TRUE, ...) { # generate normal distribution based on CI range - out <- .posterior_ci(x, ci, ...) + result <- .posterior_ci(x, ci, ...) + + # copy + out <- result$out + posterior <- result$posterior # calculate the ROPE range if (all(threshold == "default")) { @@ -198,7 +202,7 @@ p_significance.lm <- function(x, threshold = "default", ci = 0.95, verbose = TRU colnames(posterior) <- paste0(out$Parameter, "_", comps) out$Parameter <- paste0(out$Parameter, "_", comps) } - out + list(out = out, posterior = posterior) }