Mode and Credible Interval Calculation for The Difference between Two Beta Distributions
Source:R/sumbetadiff.R
sumBetaDiff.Rd
A function to summarize the characters of a betadiff distribution dbetadiff()
.
May require use of random sample generator to calculate, use set.seed()
to reproduce results.
Arguments
- parX
(
numeric
):
two parameters ofX
's Beta distribution (Control)- parY
(
numeric
):
two parameters ofY
's Beta distribution (Treatment)- ci_level
(
numeric
):
level for credible interval- 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
Value
List with the mode, credible interval for the difference,
along with the go
and stop
probabilities.
Examples
parX <- c(1, 52) # Control group's parameters
parY <- c(5.5, 20.5) # Treatment group's parameters
sumBetaDiff(
parX = parX,
parY = parY,
ci_level = 0.9,
go_cut = 0.6,
stop_cut = 0.2
)
#> $mode
#> [1] 0.1704321
#>
#> $ci
#> [1] 0.07269902 0.33643341
#>
#> $go
#> [1] 1.151637e-05
#>
#> $stop
#> [1] 0.5682951
#>