analysis(matlab): add log(day) model + Cohen's f + power to every variation

Add variation_logpower.m (self-contained) + make_variation_logpower.m,
dropping logpowersim.m + logpower_result.txt into all 28 variation folders.
Matches the paper's power code: models behavior ~ stim + log(day) +
stim:log(day) + (1|rat) (log(day+1), since our day 0 = paper Day 1), reports
Cohen's f (partial eta^2 of the interaction) and the interaction under
residual/Satterthwaite/honest random-slope DF, then runs the Monte-Carlo power
sim on the log-day ground truth (per-animal cluster-honest + LME power).

Notable: under log(day) the accumulating divergence is captured more sharply,
so several full-window scenarios reach honest significance that were n.s. under
raw day (e.g. right_only_d0_13 honest p=0.003, unmerge_d0_13 0.021,
unmerge_d0_10 0.036); Cohen's f is small-medium (~0.10-0.34).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Experiments DB Dev
2026-07-23 14:37:50 -04:00
parent bb5e2d88c0
commit 378ad6da05
58 changed files with 5328 additions and 0 deletions
@@ -0,0 +1,36 @@
==============================================================================
LOG-DAY MODEL + COHEN'S f + POWER -- matched_current_d0_3
==============================================================================
model: behavior ~ stim + log(day) + stim:log(day) + (1|rat) (success COUNT)
log(day) uses 1-indexed training day (our day 0 = paper "Day 1")
observed groups: stim n=3, control n=3 nrep=120, alpha=0.05
--- fitted on real data ---
stim x log(day) interaction: F(1,20)=7.043 p(resid)=0.01524 p(Satt)=0.0139 (df=24)
honest per-animal random slope (log-day): F(1,18.5)=7.24 p=0.01475
Cohen's f (interaction, partial eta^2=0.102) = 0.336 (medium; f: .10 small, .25 medium, .40 large)
--- power simulation (log-day ground truth: stim:logday=+20.79, ratSD=0.00, resSD=9.99) ---
true stim:log(day) = +20.79 (100% of observed)
N/group | per-animal power | LME power
------------------------------------------
3 | 0.39 | 0.77 <- observed
5 | 0.84 | 0.93
8 | 0.97 | 0.99
12 | 1.00 | 1.00
16 | 1.00 | 1.00
24 | 1.00 | 1.00
true stim:log(day) = +10.40 (50% of observed)
N/group | per-animal power | LME power
------------------------------------------
3 | 0.11 | 0.23 <- observed
5 | 0.33 | 0.47
8 | 0.49 | 0.59
12 | 0.80 | 0.79
16 | 0.79 | 0.84
24 | 0.95 | 0.97
Read the per-animal column as the honest power; the LME column matches the
paper's power code (anova interaction p, observation-level DF) and is optimistic.