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>
The model already evaluates the tDCS main effect at day 0, which is the paper's
'Day 1'; relabel the report/docstring to state the equivalence explicitly so the
'equal on Day 1' comparison is unambiguous. No model change (re-indexing day
would move the main-effect evaluation point off Day 1). Suite 31/31.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
fitglme coefTest only offers observation-level DF (df2~=178), which overstates
the group x day interaction significance for this few-subject design (p~=0 in
every scenario). Replace the reported learning-rate result with a cluster-honest
per-animal slope test (per-subject OLS slope of success vs day, Welch + MWU,
B2 vs A2) -- now correctly parallel in all 6 scenarios, matching the Python GEE.
The GLMM F-test is kept as a flagged reference only. Adds a regression test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Poisson GEE / binomial rate / learning-rate models, subject random-intercept
sensitivity, unknown-group classification and merge scenarios, plus METHODS.md
and learning-curve plots. Data reconstructed from the experiment DB and
verified against the exported matrix.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Final code review of the configurable-data-export feature: ExperimentDetail
was forwarding its on-page groupField state (defaults to '__name__') into
ExportDataModal, leaking a clustering default into the default (untouched)
export. Now passes the raw saved localStorage value, defaulting to
'__none__'. The modal also now validates the incoming groupField against
'__none__'/'__name__'/'__id__'/active subjectTemplate fields and coerces to
'__none__' otherwise, guarding against stale/deleted subject_info fields.
Plus a stale module comment fix and optional-chaining consistency fix in
listSubjectMembers.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Client-side CSV export on the experiment page: pick a daily parameter
(session metrics or any daily-record field) and download a date×subject matrix.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>