Skip to contents

This function will plot the PDF of a difference between two Beta distributions

Usage

plotBetaDiff(
  parX,
  parY,
  go_cut = 0.2,
  stop_cut = 0.1,
  shade = TRUE,
  note = TRUE
)

Arguments

parX

(numeric):
non-negative parameters of the control Beta distribution

parY

(numeric):
non-negative parameters of the treatment Beta distribution.

go_cut

(number):
a meaningful improvement threshold, the lower boundary of a meaningfully improvement in response rate

stop_cut

(number):
a poor improvement threshold, the upper boundary of a meaningfully poor improvement in response rate

shade

(flag):
paint the two areas under the curve, default value = TRUE

note

(flag):
show values of the colored area, default value = TRUE

Value

a ggplot object

Examples

# The following examples use these parameters:
parX <- c(1, 52)
parY <- c(5.5, 20.5)

# Calculate probability based on quantile `Q(Z) =< 0.122838`
pbetadiff(
  q = 0.122838,
  parY = parY,
  parX = parX
)
#> [1] 0.2000019

# Calculate probability based on quantile `Q(Z) =< 0.5`
pbetadiff(
  q = 0.5,
  parY = parY,
  parX = parX
)
#> [1] 0.9993969