This function provides a modular and extensible way to compute performance measures (PM) for Data-Generating Mechanisms (DGMs). It handles different types of measures and automatically determines the required arguments for each measure function.
compute_single_measure(
dgm_name,
measure_name,
method,
method_setting,
conditions,
measure_fun,
measure_mcse_fun,
power_test_type = "p_value",
estimate_col = "estimate",
true_effect_col = "mean_effect",
ci_lower_col = "ci_lower",
ci_upper_col = "ci_upper",
p_value_col = "p_value",
bf_col = "BF",
convergence_col = "convergence",
power_threshold_p_value = 0.05,
power_threshold_bayes_factor = 10,
method_replacements = NULL,
n_repetitions = 1000,
overwrite = FALSE,
...
)TRUE upon successfully computation of the results file
Character string specifying the DGM name
Name of the measure to compute (e.g., "bias", "mse")
Character vector of method names
Character vector of method settings, must be same length as method
Data frame of conditions from dgm_conditions()
Function to compute the measure
Function to compute the MCSE for the measure
Character vector specifying the test type for power computation: "p_value" (default) or "bayes_factor" for each method. If a single value is provided, it is repeated for all methods.
Character string specifying the column name containing parameter estimates. Default is "estimate"
Character string specifying the column name in conditions data frame containing true effect sizes. Default is "mean_effect"
Character string specifying the column name containing lower confidence interval bounds. Default is "ci_lower"
Character string specifying the column name containing upper confidence interval bounds. Default is "ci_upper"
Character string specifying the column name containing p-values. Default is "p_value"
Character string specifying the column name containing Bayes factors. Default is "BF"
Character string specifying the column name containing convergence indicators. Default is "convergence"
Numeric threshold for power computation with p-values. Default is 0.05 (reject H0 if p < 0.05).
Numeric threshold for power computation with Bayes factors. Default is 10 (reject H0 if BF > 10)
Named list of replacement method specifications. Each element should be named with the "method-method_setting" combination (e.g., "RMA-default") and contain a named list with:
method: Character vector of replacement method names
method_setting: Character vector of replacement method settings (same length as methods)
power_test_type: Optional character vector of power test types for each replacement method (same length as methods). If not specified, uses the main power_test_type parameter
If multiple elements are specified within the vectors, these replacements are applied consecutively
in case the previous replacements also failed to converge.
Defaults to NULL, i.e., omitting repetitions without converged results on method-by-method basis.
Number of repetitions in each condition. Necessary method replacement. Defaults to 1000.
Logical indicating whether to overwrite existing results. If FALSE (default), will skip computation for method-measure combinations that already exist
Additional arguments passed to measure functions