Summary method for objects of class "bayesTest".

# S3 method for bayesTest
summary(
  object,
  percentLift = rep(0, length(object$posteriors)),
  credInt = rep(0.9, length(object$posteriors)),
  ...
)

Arguments

object

an object of class "bayesTest"

percentLift

a vector of length(x$posteriors). Each entry corresponds to the percent lift ((A - B) / B) to summarize for for the respective posterior in x. Note this is on a 'point' scale. percentLift = 5 implies you want to test for a 5% lift.

credInt

a vector of length(x$posteriors). Each entry corresponds to the width of credible interval of (A - B) / B to calculate for the respective posterior in x. Also on a 'point' scale.

...

additional arguments affecting the summary produced.

Value

A summaryBayesTest object which contains summaries of the Posterior distributions, direct probabilities that A > B (by percentLift), credible intervals on (A - B) / B, and the Posterior Expected Loss on all estimated parameters.

Note

The Posterior Expected Loss (https://en.wikipedia.org/wiki/Bayes_estimator) is a good indicator of when to end a Bayesian AB test. If the PEL is lower than the absolute delta of the minimum effect you wish to detect, the test can be reasonably be stopped.

Examples

A_pois <- rpois(100, 5) B_pois <- rpois(100, 4.7) AB1 <- bayesTest(A_pois, B_pois, priors = c('shape' = 25, 'rate' = 5), distribution = 'poisson') summary(AB1)
#> Quantiles of posteriors for A and B: #> #> $Lambda #> $Lambda$A #> 0% 25% 50% 75% 100% #> 4.343661 5.077286 5.226154 5.377542 6.219920 #> #> $Lambda$B #> 0% 25% 50% 75% 100% #> 4.127892 4.852087 4.996414 5.144825 6.102285 #> #> #> -------------------------------------------- #> #> P(A > B) by (0)%: #> #> $Lambda #> [1] 0.76947 #> #> -------------------------------------------- #> #> Credible Interval on (A - B) / B for interval length(s) (0.9) : #> #> $Lambda #> 5% 95% #> -0.05474198 0.15574368 #> #> -------------------------------------------- #> #> Posterior Expected Loss for choosing A over B: #> #> $Lambda #> [1] 0.008549424 #>
summary(AB1, percentLift = 10, credInt = .95)
#> Quantiles of posteriors for A and B: #> #> $Lambda #> $Lambda$A #> 0% 25% 50% 75% 100% #> 4.343661 5.077286 5.226154 5.377542 6.219920 #> #> $Lambda$B #> 0% 25% 50% 75% 100% #> 4.127892 4.852087 4.996414 5.144825 6.102285 #> #> #> -------------------------------------------- #> #> P(A > B) by (10)%: #> #> $Lambda #> [1] 0.20366 #> #> -------------------------------------------- #> #> Credible Interval on (A - B) / B for interval length(s) (0.95) : #> #> $Lambda #> 2.5% 97.5% #> -0.07237496 0.17821218 #> #> -------------------------------------------- #> #> Posterior Expected Loss for choosing A over B: #> #> $Lambda #> [1] 0.008549424 #>