analysis(matlab): add per-variation power simulation (powersim.m + power_result.txt)
Add variation_power.m (self-contained Monte-Carlo power for the paper's stim x day interaction, using each folder's own data as ground truth; scores per-animal cluster-honest power + LME power across N=[3..24] and effect multipliers 1/0.5) and make_variation_power.m, which drops powersim.m into every variations/<name>/ folder and runs it, writing power_result.txt beside the existing data.csv/analyze.m/result.txt. Named powersim (not power) to avoid shadowing the MATLAB builtin. All 28 folders processed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
==============================================================================
|
||||
POWER SIMULATION -- boxa_b2_d6_10
|
||||
==============================================================================
|
||||
model: behavior ~ stim + day + stim:day + (1|rat) (success COUNT; day within-window)
|
||||
observed groups: stim n=4, control n=2 nrep=120, alpha=0.05
|
||||
ground truth: stim:day=+1.90/day, rat SD=6.23, residual SD=8.12, days=5
|
||||
|
||||
true stim:day interaction = +1.90 (100% of observed)
|
||||
N/group | per-animal power | LME power
|
||||
------------------------------------------
|
||||
3 | 0.04 | 0.17
|
||||
5 | 0.17 | 0.24
|
||||
8 | 0.24 | 0.33
|
||||
12 | 0.38 | 0.36
|
||||
16 | 0.51 | 0.55
|
||||
24 | 0.68 | 0.71
|
||||
|
||||
true stim:day interaction = +0.95 (50% of observed)
|
||||
N/group | per-animal power | LME power
|
||||
------------------------------------------
|
||||
3 | 0.07 | 0.11
|
||||
5 | 0.09 | 0.12
|
||||
8 | 0.06 | 0.12
|
||||
12 | 0.14 | 0.14
|
||||
16 | 0.18 | 0.19
|
||||
24 | 0.25 | 0.28
|
||||
|
||||
Read the per-animal column as the honest power. At the observed N this study
|
||||
is typically underpowered; per-animal power reaches ~0.8 only at larger N.
|
||||
Reference in New Issue
Block a user