f_test_BFF {BFF} | R Documentation |
f_test_BFF
Description
f_test_BFF constructs BFFs based on the F test. BFFs depend on hyperparameters r and tau^2 which determine the shape and scale of the prior distributions which define the alternative hypotheses. By setting r > 1, we use higher-order moments for replicated studies. Fractional moments are set with r > 1 and r not an integer. All results are on the log scale. Plot saved to working directory unless a full path is specified in the 'savename' variable of the function.
Usage
f_test_BFF(
f_stat,
n,
df1,
df2,
savename = NULL,
maximize = FALSE,
r = 1,
tau2 = NULL,
save = TRUE,
xlab = NULL,
ylab = NULL,
main = NULL
)
Arguments
f_stat |
F statistic |
n |
sample size |
df1 |
first degree of freedom |
df2 |
first degree of freedom |
savename |
optional, filename for saving the pdf of the final plot |
maximize |
should the function be maximzied over all possible r values? Default is FALSE. Only set to TRUE if analyzing multiple studies |
r |
r value |
tau2 |
tau2 values (can be a single entry or a vector of values) |
save |
should a copy of the plot be saved? |
xlab |
optional, x label for plot |
ylab |
optional, y label for plot |
main |
optional, main label for plot |
Value
Returns Bayes factor function results
BFF | The log of the Bayes Factor Function values |
effect_size | Effect sizes tested (seq(0, 1, by = 0.01)) |
BFF_max_RMSE | Maximum BFF value |
max_RMSE | Effect size that maximizes BFF |
tau2 | tau^2 values tested |
Examples
fBFF = f_test_BFF(f_stat = 2.5, n = 50, df1 = 20, df2 = 48, save = FALSE)
f_test_BFF(f_stat = 2.5, n = 50, df1 = 20, df2 = 48, save = FALSE, tau2 = 0.5)
f_test_BFF(f_stat = 2.5, n = 50, df1 = 20, df2 = 48, save = FALSE, tau2 = c(0.5, 0.8))
f_test_BFF(f_stat = 2.5, n = 50, df1 = 20, df2 = 48, r = 2, save = FALSE)
f_test_BFF(f_stat = 2.5, n = 50, df1 = 20, df2 = 48, r = 2.5, save = FALSE)
f_test_BFF(f_stat=2.5, n = 50, df1 = 20, df2 = 48, maximize = TRUE)
f_test_BFF(f_stat=2.5, n = 50, df1 = 20, df2 = 48, maximize = TRUE, tau2 = 0.5)
f_test_BFF(f_stat=2.5, n = 50, df1 = 20, df2 = 48, maximize = TRUE, tau2 = c(0.5, 0.8))
fBFF$BFF_max_RMSE # maximum BFF value
fBFF$max_RMSE # effect size which maximizes the BFF value