Skip to content

Commit

Permalink
Merge pull request #96 from To-be-b/master
Browse files Browse the repository at this point in the history
Added ROPE to summary output
  • Loading branch information
DominiqueMakowski committed Sep 20, 2018
2 parents a06c377 + 76d5304 commit 8f82462
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions R/analyze.stanreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ analyze.stanreg <- function(x, CI=90, index="overlap", ROPE_bounds=NULL, effsize
Median_std = values$effects[[varname]]$std_median,
MAD_std = values$effects[[varname]]$std_mad,
MPE = values$effects[[varname]]$MPE,
ROPE = values$effects[[varname]]$ROPE,
Overlap = values$effects[[varname]]$overlap
)
)
Expand All @@ -198,6 +199,12 @@ analyze.stanreg <- function(x, CI=90, index="overlap", ROPE_bounds=NULL, effsize
if (effsize == FALSE) {
summary <- select_(summary, "-Median_std", "-MAD_std")
}

if (index == "ROPE") {
summary <- select_(summary, "-Overlap")
} else {
summary <- select_(summary, "-ROPE")
}

# Text --------------------------------------------------------------------
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -388,6 +395,7 @@ analyze.stanreg <- function(x, CI=90, index="overlap", ROPE_bounds=NULL, effsize
values$MPE <- NA
values$MPE_values <- NA
values$overlap <- NA
values$ROPE <- NA
values$adjusted_r_squared <- R2.adj

# Text
Expand Down Expand Up @@ -465,9 +473,10 @@ analyze.stanreg <- function(x, CI=90, index="overlap", ROPE_bounds=NULL, effsize
values$MPE <- NA
values$MPE_values <- NA
values$overlap <- NA



values$ROPE <- NA



# Text
values$text <- paste0(
" The intercept is at ",
Expand Down Expand Up @@ -554,6 +563,9 @@ analyze.stanreg <- function(x, CI=90, index="overlap", ROPE_bounds=NULL, effsize
rope <- rope(posterior, bounds=ROPE_bounds)
values$ROPE_decision <- rope$rope_decision
values$ROPE <- rope$rope_probability
}else{
values$ROPE <- NA
values$ROPE_decision <- NA
}

if(index == "overlap"){
Expand Down

0 comments on commit 8f82462

Please sign in to comment.