analysis(matlab): per-variation subfolders (grouping x window) for the paper LME

Add make_variations.m + variation_analyze.m generating 20 self-contained
subfolders under analysis/matlab/variations/, one per grouping x day-window,
each with exactly three files: data.csv (curated subset), analyze.m (a simple
standalone script fitting behavior ~ stim + day + stim:day + (1|rat) on the
success COUNT), and result.txt (its output). Plus variations/SUMMARY.csv.

Groupings (stim=1 / stim=0, other groups dropped):
  unmerge     B2 vs A2
  right_only  B2+Right vs A2            (Box-A dropped)
  naive_a2    B2 vs A2+Naive           (Right, Box-A dropped)
  naive_boxa  B2 vs A2+Naive+Box-A     (Right dropped)
Windows: 0-10, 0-13, 0-5, 6-10, 6-13. All 20 have equal day coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Experiments DB Dev
2026-07-20 20:49:54 -04:00
parent 963fd889b2
commit 969c0205e8
63 changed files with 4343 additions and 0 deletions
@@ -0,0 +1,65 @@
==============================================================================
VARIATION: unmerge_d0_5
==============================================================================
model: behavior ~ stim + day + stim:day + (1|rat) (behavior = success COUNT)
day = training day within window (0 = first analyzed day)
treatment (stim=1): Electrode-Box-B2
control (stim=0): Electrode-Box-A2
N = 6 rats, 36 sessions raw day coverage: treat 0..5, control 0..5
(equal day coverage over this window)
==============================================================================
FULL MODEL SUMMARY -- fitlme
==============================================================================
Linear mixed-effects model fit by ML
Model information:
Number of observations 36
Fixed effects coefficients 4
Random effects coefficients 6
Covariance parameters 2
Formula:
behavior ~ 1 + day*stim + (1 | rat)
Model fit statistics:
AIC BIC LogLikelihood Deviance
289.66 299.16 -138.83 277.66
Fixed effects coefficients (95% CIs):
Name Estimate SE tStat DF pValue
{'(Intercept)'} 12.524 5.2775 2.3731 32 0.023816
{'day' } 9.8571 1.4772 6.6729 32 1.5706e-07
{'stim' } -3.0159 7.4635 -0.40408 32 0.68884
{'day:stim' } 5.3619 2.089 2.5667 32 0.015149
Lower Upper
1.7739 23.274
6.8482 12.866
-18.219 12.187
1.1067 9.6172
Random effects covariance parameters (95% CIs):
Group: rat (6 Levels)
Name1 Name2 Type Estimate
{'(Intercept)'} {'(Intercept)'} {'std'} 4.8527
Lower Upper
1.7069 13.796
Group: Error
Name Estimate Lower Upper
{'Res Std'} 10.703 8.3104 13.785
effect t (df) F (df1) p
------------------------------------------------------------------
stim x day (interaction) t(32)= 2.57 F(1)= 6.588 p=0.01515
day (learning) t(32)= 6.67 F(1)= 44.528 p=1.571e-07
stim (main, window start) t(32)= -0.40 F(1)= 0.163 p=0.6888
interaction 95% CI: [+1.11, +9.62]
INTERPRETATION: stim x day interaction SIGNIFICANT positive -- treatment improves FASTER (benefit accumulates) (p=0.01515, slope diff=+5.36)
Paper (N=24): interaction t(227)=2.68, F(1)=7.12, p=0.008.