Commit Graph

7 Commits

Author SHA1 Message Date
Experiments DB Dev 8a18c894dd feat(matlab): add Satterthwaite DF + honest random-slope test to LME reports
Every fitlme-based report (lme_*, paper_*, phase_*, and the variations'
analyze.m) now shows, per effect: residual-DF p, Satterthwaite-DF p, and --
for the interaction -- an HONEST test from a per-animal random-SLOPE model
(day|rat), whose Satterthwaite DF collapses toward the animal count.

New: tdcs_random_slope_interaction.m (shared helper). Wired into tdcs_lme,
tdcs_paper_lme, tdcs_phase_lme, variation_analyze; SUMMARY.csv gains
interaction_p_satt / interaction_p_rs. Regenerated all results/, variations/,
matched-effort outputs.

Key point this surfaces: Satterthwaite ~= residual on the random-INTERCEPT
model (the slope's error is at session level), so it does NOT fix
pseudoreplication; the random-slope model does. Effect: full-range mergeA2
interaction 0.009 -> 0.75 (collapses); unmerge_d0_5 0.015 -> 0.13 (n.s.);
the pooled-control early windows survive honestly (naive_a2_d0_5 0.001 ->
0.028; naive_boxa_d0_5 0.003 -> 0.036). Suite 42/42.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 15:45:19 -04:00
Experiments DB Dev 963fd889b2 feat(matlab): windowed paper-LME replication for mergeNaive (d0_10, d0_13)
Make tdcs_paper_lme window-aware (windowKey 'full'|'d0_10'|'d0_13',
default 'full' -> unchanged filename). Windowed runs give the two anchor
arms equal day coverage, so the stim:day interaction is not confounded by
the full-range coverage imbalance; the report now states whether coverage
is equal and adds an INTERPRETATION block. Add switch cases
paper_mergeNaive_d0_10 / _d0_13 and include them in run_all.

Finding: unlike mergeA2 (fair-window interaction n.s.), the pooled-naive
control keeps the interaction significant in the fair d0_13 window
(F(1)=7.07, p=0.0088, +1.80 [+0.46,+3.14]; equal on Day 1 p=0.20),
reproducing the paper without the coverage confound; d0_10 is borderline
(p=0.051).

Tests: tLme asserts equal coverage / no warning / one full summary for
both windows and a significant positive d0_13 interaction; bad windowKey
errors. Suite 41/41.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 17:49:09 -04:00
Experiments DB Dev 0e9263b958 feat(matlab): print full native fitlme/fitglme summary in every scenario
Add tdcs_model_summary as the single place that renders a fitted model
verbatim (disp(model) with the Command-Window <strong> markup stripped),
and route every report through it so all scenarios emit the complete
model-fitting output:

- tdcs_report: adds the learning-rate GLMM's full summary (count/rate
  already had theirs); localCleanDisp now delegates to the shared helper.
- tdcs_lme_report / tdcs_paper_lme: embed the full fitlme summary before
  the curated effect table.
- tdcs_phase_lme: appends each phase's full fitlme summary.

Tests: tReport asserts 3 native summaries in a GLMM report; tLme asserts
the lme_*/paper_*/phase_* reports embed 1/1/3 summaries with markup
stripped. Suite 39/39.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 14:21:34 -04:00
Experiments DB Dev 77b631bcac feat(matlab): mergeNaive grouping (control=A2+Naive, tDCS=B2+Right) + GLM/power
Adds cfg.mergeNaive and scenario/paper/phase/power support. This pooled grouping
is the closest replication of the paper's full pattern: paper LME interaction
F(1)=7.30, p=0.008 (paper 7.12/0.008), stim main n.s. (p=0.21 = equal on Day 1),
strong day effect; the overall tDCS advantage is significant at the cluster-honest
per-animal level (rate p=0.003) and well powered. Adds a grouping test. Suite 38/38.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 12:50:35 -04:00
Experiments DB Dev 7b5c27df8c feat(matlab): verbatim paper LME (behavior ~ stim+day+stim:day+(1|rat)) + power sim on it
Adds tdcs_paper_lme replicating the paper's exact formula/variable names (paper_*
switch cases): mergeA2 reproduces the interaction F(1)=7.09 vs 7.12, p=0.009 vs
0.008, with a coverage-confound warning. Rewrites tdcs_power_sim to fit that same
formula (interaction term canonicalized to day:stim). Adds a replication test.
Suite 37/37.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 12:40:26 -04:00
Experiments DB Dev 89bb95088f feat(matlab): add 0-13 day window (lme_*_d0_13) + coverage warning
Box-A2 has no data past ~day 13, so the full-range days x tDCS interaction
extrapolates A2's slope and is confounded (spuriously significant, wrong sign).
Add the _d0_13 window (equal anchor coverage) and a report warning when the two
groups' day coverage is unequal. In the fair 0-13 window the interaction is n.s.
with a POSITIVE slope diff and the Day-1 tDCS effect is n.s. -- matching the
paper's 'equal on Day 1' direction (underpowered at n=8). Suite 32/32.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 09:58:19 -04:00
Experiments DB Dev 08c14c476c feat(matlab): add linear days x tDCS mixed-model scenarios (lme_*)
Adds 6 switch cases replicating the paper's linear mixed model
success ~ day * tDCS + (1|subject) on the Box-B2(tDCS=1) vs Box-A2(tDCS=0)
arm, reporting the days x tDCS interaction, days, and tDCS effects as t/F/p.
mergeA2_full reproduces the paper's interaction (F=7.09 vs 7.12, p=0.009 vs
0.008); interpretation is sign-aware and honestly notes our data diverges from
the paper (Box-B2 ahead on day 1, gap narrows -- not 'equal on day 1,
accumulates'). Adds tLme tests. Suite 31/31.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 09:43:08 -04:00