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>
This commit is contained in:
Experiments DB Dev
2026-07-20 12:50:35 -04:00
parent 7b5c27df8c
commit 77b631bcac
6 changed files with 62 additions and 2 deletions
+16
View File
@@ -155,3 +155,19 @@ matlab -batch "tdcs_glm('paper_mergeA2')" # or paper_unmerged / paper_mergeB2
also warns that the full-range interaction is confounded by unequal day coverage (Box-A2 ends
~day 13) — see the _d0_13 and phased analyses. The Monte-Carlo power analysis (`run_power`,
`tdcs_power_sim`) uses this same `behavior ~ stim + day + stim:day + (1|rat)` model.
## mergeNaive: pooled control vs tDCS
`mergeNaive` pools Naive into the control side (control = Box-A2 + Naive, n=7) and
Right-Electrode into the tDCS side (tDCS = Box-B2 + Right-Electrode, n=4); Box-A is left
out of the anchor contrast. Run the GLMMs, the paper LME, and power:
```
matlab -batch "tdcs_glm('mergeNaive_full')" # GLMM (rate/count) tDCS vs control
matlab -batch "tdcs_glm('paper_mergeNaive')" # paper LME: behavior ~ stim+day+stim:day+(1|rat)
matlab -batch "tdcs_power_sim('mergeNaive',[0 5])"
```
With the larger pooled control this is the closest replication of the paper's full pattern:
a significant days x tDCS interaction (F(1)=7.30, p=0.008 vs paper 7.12/0.008), an equal-on-Day-1
stim main effect (p=0.21, matching the paper's n.s.), and a strong day effect. The overall tDCS
advantage is significant even at the cluster-honest per-animal level (rate p=0.003). Caveat:
pooling Naive (no-stimulation control) with Box-A2 (an electrode condition) is a modeling choice.