two_p_summarize.RdComputes posterior of difference P2 - P1 of a probability matrix of two proportions
two_p_summarize(prob_matrix)
| prob_matrix | probability matrix where the rows and columns are labeled with the values of the proportions |
|---|
data frame with variables diff21 and Prob where diff21 = P2 - P1
# use uniform prior over values .2, .3, .4 prior <- testing_prior(.2, .4, 3, uniform=TRUE) two_p_summarize(prior)#> # A tibble: 5 x 2 #> diff21 Prob #> <dbl> <dbl> #> 1 -0.2 0.111 #> 2 -0.1 0.222 #> 3 0 0.333 #> 4 0.1 0.222 #> 5 0.2 0.111