analysis(matlab): matched-effort comparison (prev _f full vs current 0-3)

Add make_matched_effort.m: pick the current-study day cutoff whose per-animal
cumulative attempts best match the previous (_f) study's full-span total
(~405 attempts/animal -> current days 0-3), then fit the paper LME on both.

Two variation folders (data.csv + analyze.m + result.txt):
  variations/prev_f_full/            b2_f vs a2_f, days 0-9  (24 rats)
  variations/matched_current_d0_3/   Box-B2 vs Box-A2, 0-3   (6 rats)

At matched cumulative effort both show a significant positive stim x day
interaction (prev p=0.008 +0.56/day; current-0-3 p=0.004 +10.2/day) -- the
tDCS acceleration replicates at equal practice, though the count slopes are
not directly comparable across datasets given differing attempts/session.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Experiments DB Dev
2026-07-22 14:39:15 -04:00
parent d9b65a3279
commit 9af33e747e
7 changed files with 634 additions and 0 deletions
@@ -0,0 +1,65 @@
==============================================================================
VARIATION: prev_f_full
==============================================================================
model: behavior ~ stim + day + stim:day + (1|rat) (behavior = success COUNT)
day = training day within window (0 = first analyzed day)
treatment (stim=1): b2_f
control (stim=0): a2_f
N = 24 rats, 231 sessions raw day coverage: treat 0..9, control 0..9
(equal day coverage over this window)
==============================================================================
FULL MODEL SUMMARY -- fitlme
==============================================================================
Linear mixed-effects model fit by ML
Model information:
Number of observations 231
Fixed effects coefficients 4
Random effects coefficients 24
Covariance parameters 2
Formula:
behavior ~ 1 + day*stim + (1 | rat)
Model fit statistics:
AIC BIC LogLikelihood Deviance
1416.2 1436.9 -702.11 1404.2
Fixed effects coefficients (95% CIs):
Name Estimate SE tStat DF pValue
{'(Intercept)'} 7.7376 1.4647 5.2828 227 2.9782e-07
{'day' } 1.3487 0.15094 8.9352 227 1.4298e-16
{'stim' } 1.8961 2.0698 0.9161 227 0.36059
{'day:stim' } 0.56023 0.21043 2.6623 227 0.0083151
Lower Upper
4.8515 10.624
1.0513 1.6461
-2.1823 5.9745
0.14559 0.97488
Random effects covariance parameters (95% CIs):
Group: rat (24 Levels)
Name1 Name2 Type Estimate
{'(Intercept)'} {'(Intercept)'} {'std'} 4.3164
Lower Upper
3.1535 5.9081
Group: Error
Name Estimate Lower Upper
{'Res Std'} 4.4892 4.0771 4.9429
effect t (df) F (df1) p
------------------------------------------------------------------
stim x day (interaction) t(227)= 2.66 F(1)= 7.088 p=0.008315
day (learning) t(227)= 8.94 F(1)= 79.838 p=1.43e-16
stim (main, window start) t(227)= 0.92 F(1)= 0.839 p=0.3606
interaction 95% CI: [+0.15, +0.97]
INTERPRETATION: stim x day interaction SIGNIFICANT positive -- treatment improves FASTER (benefit accumulates) (p=0.008315, slope diff=+0.56)
Paper (N=24): interaction t(227)=2.68, F(1)=7.12, p=0.008.