Returns the smallest n per effect setting that meets user-specified targets. Works with both brms_inla_power() and brms_inla_power_sequential() outputs.
decide_sample_size(
x,
direction = NULL,
threshold = NULL,
rope_in = NULL,
bf10 = NULL,
bf_prop_min = 0,
targets = NULL
)A data.frame with recommended n per effect combination and the rationale.
A list with $summary (engine output) or a data.frame summary itself.
Numeric in \([0, 1]\), required power for power_direction (optional).
Numeric in \([0, 1]\), required power for power_threshold (optional).
Numeric in \([0, 1]\), maximum allowed Pr(in ROPE) (optional).
Note: since summaries usually contain power_rope = Pr(outside ROPE) >= prob_threshold,
we compare (1 - power_rope) <= rope_in when rope_in is given.
Numeric Bayes-factor cutoff (e.g., 10). If provided, we look for a column
named bf_hit_<bf10>; if not found, we fall back to any bf_hit_* column present.
Numeric in \([0, 1]\), the minimum proportion of simulations that must
achieve BF >= bf10 (default 0).
Optional list alternative to the direct args. Ignored if any direct arg is non-NULL.
You can pass targets directly via arguments (direction, threshold, rope_in, bf10)
or via targets = list(direction=..., threshold=..., rope_in=..., bf10=...).
Direct arguments take precedence if supplied.