Perform sample size determination or the calculation of compelling and misleading evidence for a Bayesian comparison of two proportions.
BFpower.props(
D = NULL,
target = NULL,
a0 = NULL,
b0 = NULL,
a1 = NULL,
b1 = NULL,
a2 = NULL,
b2 = NULL,
model1 = NULL,
a1d = NULL,
b1d = NULL,
dp1 = NULL,
model2 = NULL,
a2d = NULL,
b2d = NULL,
dp2 = NULL,
mode_bf = NULL,
n1 = NULL,
n2 = NULL,
direct = NULL
)A data frame with the following columns:
p(BF10 > D | H1): Probability of obtaining compelling evidence
in favor of the alternative hypothesis when the alternative is true.
p(BF01 > D | H1): Probability of obtaining misleading evidence
in favor of the null hypothesis when the alternative is true.
p(BF01 > D | H0): Probability of obtaining compelling evidence
in favor of the null hypothesis when the null is true.
p(BF10 > D | H0): Probability of obtaining misleading evidence
in favor of the alternative hypothesis when the null is true.
Required N1: The required sample size for group 1 or the sample size input by the user.
Required N2: The required sample size for group 1 or the sample size input by the user.
If sample size determination fails, the function returns NULL.
The bound of compelling evidence.
The targeted true positive rate (if direct = "h1") or true negative rate (if direct = "h0").
Alpha parameter of the beta distribution under the null .
Beta parameter of the beta distribution under the null.
Alpha parameter of the analysis beta prior distribution for group 1 under the alternative hypothesis.
Beta parameter of the analysis beta prior distribution for group 1 under the alternative hypothesis.
Alpha parameter of the analysis beta prior distribution for group 2 under the alternative hypothesis.
Beta parameter of the analysis beta prior distribution for group 2 under the alternative hypothesis.
Statistical model of the design prior for group 1: beta ("beta"), Point prior ("Point", or same as analysis prior "same")
Alpha parameter for the design prior of group 1.
Beta parameter for the design prior of group 1.
True proportion for group 1 in the design prior.
Statistical model of the design prior for group 1: beta ("beta"), or Point prior ("Point", or same as analysis prior "same")
Alpha parameter for the design prior of group 2.
Beta parameter for the design prior of group 2.
True proportion for group 2 in the design prior.
Integer (0 or 1). If 1, sample size determination; if 2, n1 and n2 are used for the calculation of probabilities of compelling and misleading evidence.
Sample size for group 1.
Sample size for group 2.
If "h1", BF10; if "h0", BF01.
BFpower.props(
D = 3,
target = 0.8,
a0 = 1,
b0 = 1,
model1 = "same",
a1 = 1,
b1 = 1,
a2 = 1,
b2 = 1,
model2 = "same",
mode_bf = 1,
direct = "h1"
)
Run the code above in your browser using DataLab