Perform sample size determination or the calculation of compelling and misleading evidence for a Bayesian correlation test.
BFpower.cor(
hypothesis = NULL,
h0 = NULL,
e = NULL,
interval = NULL,
D = NULL,
target = NULL,
FP = NULL,
model = NULL,
k = NULL,
alpha = NULL,
beta = NULL,
scale = NULL,
model_d = NULL,
alpha_d = NULL,
beta_d = NULL,
location_d = NULL,
k_d = NULL,
scale_d = NULL,
de_an_prior = NULL,
N = NULL,
mode_bf = 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 N: The required sample size or the sample size input by the users.
If sample size determination fails, the function returns NULL.
The hypothesis being tested (e.g., two-sided "!=", right-sided ">", left-sided "<").
Null value of the correlation.
The bounds for the interval Bayes factor (used when interval = 0).
Character or integer (0 or 1). If "1", Bayes factor with a point null against a composite alternative hypothesis;
otherwise Bayes factor with interval null and alternative hypotheses.
The bound of compelling evidence.
The targeted true positive rate (if direct = "h1") or true negative rate (if direct = "h0").
The targeted false positive rate (if direct = "h1") or false negative rate (if direct = "h0").
Statistical model of the analysis prior under the alternative hypothesis: default beta ("d_beta"), beta ("beta"), or normal moment ("NLP")
Parameter for the analysis default beta prior under the alternative hypothesis.
Parameter for the analysis beta prior under the alternative hypothesis.
Parameter for the analysis beta prior under the alternative hypothesis.
Scale parameter for the analysis normal moment prior under the alternative hypothesis.
Statistical model of the design prior under the alternative hypothesis:default beta ("d_beta"), beta ("beta"), normal moment ("NLP" , or point "Point")
Parameter for the design beta prior under the alternative hypothesis.
Parameter for the design beta prior under the alternative hypothesis.
Location parameter for the design point prior under the alternative hypothesis.
Parameter for the design default beta prior under the alternative hypothesis.
Scale parameter for the design normal moment prior under the alternative hypothesis.
Integer (0 or 1). If 1, analysis and design priors under the alternative are the same; if 0, they are not.
Sample size.
Integer (0 or 1). If 1, sample size determination; if 2, N is needed for the calculation of probabilities of compelling and misleading evidence.
If "h1", BF10; if "h0", BF01.
BFpower.cor(
hypothesis = "!=",
h0 = 0,
e = NULL,
interval = "1",
D = 3,
target = 0.8,
FP = 0.05,
model = "d_beta",
k = 1,
de_an_prior = 1,
mode_bf = 1,
direct = "h1"
)
Run the code above in your browser using DataLab