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>
This commit is contained in:
Experiments DB Dev
2026-07-20 09:43:08 -04:00
parent b1057f6105
commit 08c14c476c
5 changed files with 217 additions and 3 deletions
+31 -1
View File
@@ -9,6 +9,10 @@ function tdcs_glm(scenario)
% unmerged_full, unmerged_d0_10,
% mergeA2_full, mergeA2_d0_10,
% mergeB2_full, mergeB2_d0_10
% or a linear "days x tDCS" mixed model (Box-B2 vs Box-A2, per the paper):
% lme_unmerged_full, lme_unmerged_d0_10,
% lme_mergeA2_full, lme_mergeA2_d0_10,
% lme_mergeB2_full, lme_mergeB2_d0_10
%
% Each case below is a self-contained, independently invocable call of
% the same three-function pipeline; they are enumerated explicitly
@@ -54,11 +58,37 @@ switch scenario
R = tdcs_models(S, meta, cfg);
tdcs_report(S, R, meta, cfg, 'mergeB2_d0_10');
% --- Linear "days x tDCS" mixed model (Box-B2 vs Box-A2), per the paper ---
case 'lme_unmerged_full'
L = tdcs_lme(tdcs_scenario_data('unmerged_full'), cfg);
tdcs_lme_report(L, 'lme_unmerged_full', cfg);
case 'lme_unmerged_d0_10'
L = tdcs_lme(tdcs_scenario_data('unmerged_d0_10'), cfg);
tdcs_lme_report(L, 'lme_unmerged_d0_10', cfg);
case 'lme_mergeA2_full'
L = tdcs_lme(tdcs_scenario_data('mergeA2_full'), cfg);
tdcs_lme_report(L, 'lme_mergeA2_full', cfg);
case 'lme_mergeA2_d0_10'
L = tdcs_lme(tdcs_scenario_data('mergeA2_d0_10'), cfg);
tdcs_lme_report(L, 'lme_mergeA2_d0_10', cfg);
case 'lme_mergeB2_full'
L = tdcs_lme(tdcs_scenario_data('mergeB2_full'), cfg);
tdcs_lme_report(L, 'lme_mergeB2_full', cfg);
case 'lme_mergeB2_d0_10'
L = tdcs_lme(tdcs_scenario_data('mergeB2_d0_10'), cfg);
tdcs_lme_report(L, 'lme_mergeB2_d0_10', cfg);
otherwise
error('tdcs_glm:badScenario', ...
['Unrecognized scenario "%s". Valid scenarios are: ' ...
'unmerged_full, unmerged_d0_10, mergeA2_full, mergeA2_d0_10, ' ...
'mergeB2_full, mergeB2_d0_10.'], scenario);
'mergeB2_full, mergeB2_d0_10, and their lme_* variants ' ...
'(lme_unmerged_full, ..., lme_mergeB2_d0_10).'], scenario);
end
end