
Two-arm power for the planned human study, priced from the silicon pilot
Source:R/calibrate.R
panel_power.RdAnalytic two-arm sample sizes with dispersion priors taken from the
silicon responses: Likert items use the pilot standard deviation of
score; choice items use the pilot share of the modal option; open
items are skipped. The priors inherit the panel's calibration status –
an uncalibrated pilot prices the design stage, it does not certify
effect sizes.
Arguments
- responses
A
panel_administer()result (the silicon pilot).- effect
Raw minimum detectable difference between the two arms: scale points for Likert items, a difference in proportions for choice items. A scalar (recycled) or a named vector keyed by
item_id.- items
Optional character vector restricting which items to price.
- focal
Optional named character vector keyed by
item_id, giving the focal response level whose proportion the power calculation should target. For a binary choice item the modal option is a well-defined estimand andfocalis optional; for a choice item with three or more options the "modal share" is not a meaningful single proportion, so name the focal response here. Without afocalfor a 3+-option item, the modal share is used and a warning is issued.- alpha
Two-sided test size.
- power
Target power.
Value
A tibble: item_id, type, dispersion (sd for Likert, the focal
or modal share for choice), effect, n_per_arm.
Examples
if (FALSE) { # \dontrun{
set.seed(110)
panel <- panel_from_margins(list(group = c(A = .5, B = .5)), n = 8)
instr <- panel_instrument(list(
item_likert("lik", "Rate the proposal.", scale = c("low", "mid", "high")),
item_choice("pick", "Pick one.", c("A", "B"))),
randomize = character(0))
cfg <- LLMR::llm_config("groq", "openai/gpt-oss-20b")
r <- panel_administer(panel, instr, cfg)
panel_power(r, effect = c(lik = 0.5, pick = 0.2))
} # }