repairsplit 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. repairsplit-0.1.0/LICENSE +21 -0
  2. repairsplit-0.1.0/MANIFEST.in +4 -0
  3. repairsplit-0.1.0/PKG-INFO +224 -0
  4. repairsplit-0.1.0/README.md +206 -0
  5. repairsplit-0.1.0/docs/DATA_ACCESS.md +59 -0
  6. repairsplit-0.1.0/docs/DATA_FORMAT.md +64 -0
  7. repairsplit-0.1.0/docs/VALIDATION.md +367 -0
  8. repairsplit-0.1.0/pyproject.toml +33 -0
  9. repairsplit-0.1.0/repairsplit/__init__.py +3 -0
  10. repairsplit-0.1.0/repairsplit/__main__.py +3 -0
  11. repairsplit-0.1.0/repairsplit/analyze.py +254 -0
  12. repairsplit-0.1.0/repairsplit/cli.py +113 -0
  13. repairsplit-0.1.0/repairsplit/crossover.py +183 -0
  14. repairsplit-0.1.0/repairsplit/mixture.py +197 -0
  15. repairsplit-0.1.0/repairsplit/moderators.py +163 -0
  16. repairsplit-0.1.0/repairsplit/power.py +89 -0
  17. repairsplit-0.1.0/repairsplit/simulate.py +144 -0
  18. repairsplit-0.1.0/repairsplit/variance.py +140 -0
  19. repairsplit-0.1.0/repairsplit.egg-info/PKG-INFO +224 -0
  20. repairsplit-0.1.0/repairsplit.egg-info/SOURCES.txt +31 -0
  21. repairsplit-0.1.0/repairsplit.egg-info/dependency_links.txt +1 -0
  22. repairsplit-0.1.0/repairsplit.egg-info/entry_points.txt +2 -0
  23. repairsplit-0.1.0/repairsplit.egg-info/requires.txt +8 -0
  24. repairsplit-0.1.0/repairsplit.egg-info/top_level.txt +1 -0
  25. repairsplit-0.1.0/results/known_answer.csv +121 -0
  26. repairsplit-0.1.0/results/summary_statistic_checks.json +27 -0
  27. repairsplit-0.1.0/results/tables.md +186 -0
  28. repairsplit-0.1.0/results/trial_designs.csv +43 -0
  29. repairsplit-0.1.0/results/trial_detectable_effect.csv +13 -0
  30. repairsplit-0.1.0/setup.cfg +4 -0
  31. repairsplit-0.1.0/tests/test_cli.py +72 -0
  32. repairsplit-0.1.0/tests/test_known_answer.py +86 -0
  33. repairsplit-0.1.0/tests/test_methods.py +164 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cedric Conday
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include LICENSE README.md
2
+ graft docs
3
+ graft results
4
+ global-exclude *.pyc
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: repairsplit
3
+ Version: 0.1.0
4
+ Summary: Did some trial participants respond and others not, or did everyone shift a little? Methods and known-answer tests for small myelin-repair trials.
5
+ Author: Cedric Conday
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: numpy>=1.24
11
+ Requires-Dist: scipy>=1.10
12
+ Requires-Dist: pandas>=2.0
13
+ Requires-Dist: statsmodels>=0.14
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7; extra == "dev"
16
+ Requires-Dist: ruff>=0.4; extra == "dev"
17
+ Dynamic: license-file
18
+
19
+ # RepairSplit
20
+
21
+ Statistics for one question about small trials of myelin repair in multiple sclerosis.
22
+
23
+ Nothing here is medical advice. It describes trial statistics, not people, and it says nothing
24
+ about whether anyone should take any drug.
25
+
26
+ ## The question
27
+
28
+ A trial reports that a drug shortened visual evoked potential latency by a millisecond or two on
29
+ average. Did some participants respond and others not? Or did everyone shift a little?
30
+
31
+ The average cannot tell. Both stories give the same average.
32
+
33
+ The trials are small, about 50 to 70 people. They measure a continuous outcome: mainly P100
34
+ latency in milliseconds, also MRI values per lesion. They are either two-arm parallel trials or
35
+ two-period crossovers.
36
+
37
+ No participant-level data from these trials is public. It is available on request only (see
38
+ `docs/DATA_ACCESS.md`). So this version contains:
39
+
40
+ 1. the methods;
41
+ 2. proof on simulated trials where the answer is known;
42
+ 3. a statement of what each published trial design could and could not have detected.
43
+
44
+ It has not been run on real trial data.
45
+
46
+ ## The headline
47
+
48
+ **Trials of this size cannot tell responders from a uniform shift at the effect sizes they
49
+ reported.**
50
+
51
+ Each row takes a published trial design and asks: suppose half the participants got twice the
52
+ reported mean effect and the other half got nothing. How often would each method notice? The
53
+ range is over the assumed noise level, which is not published (see below). The last column is
54
+ how often the same methods fire when everyone truly shifts by the same amount.
55
+
56
+ | Trial design | Reported mean effect | Variance test | Mixture check | False-positive rate |
57
+ |---|---|---|---|---|
58
+ | Clemastine crossover (ReBUILD), 50 people, trial data alone | 1.7 ms | **no test possible** | 5% | 5% to 6% |
59
+ | Same, with an outside test-retest noise estimate from 39 people | 1.7 ms | 7% to 14% | 5% | 5% to 6% |
60
+ | Same, noise known exactly (best case) | 1.7 ms | 10% to 23% | 5% | 5% to 6% |
61
+ | Bexarotene (CCMR One), 26 per arm, lesional MTR | 0.16 pu | 5% to 6% | 4% | 4% to 5% |
62
+ | Bexarotene (CCMR One), 28 people with delayed VEP | 4.06 ms | 12% to 36% | 6% to 7% | 4% to 6% |
63
+ | Metformin plus clemastine (CCMR Two), 33 and 34 | 1.2 ms | 5% to 16% | 5% to 6% | 4% to 6% |
64
+
65
+ A power of 5% is the same as the false-positive rate. It means the method sees nothing.
66
+
67
+ To reach 80% power on a half split, responders would have to improve by 2 to 3.5 times the SD of
68
+ a change score. At an SD of 5 ms that is 10 to 17.5 ms in the responders. The reported mean
69
+ effects are 1.2 to 4.1 ms.
70
+
71
+ In plain words: these trials were built to detect an average effect, and some did. They were not
72
+ built to say who responded, and they cannot. A statement such as "about half of patients
73
+ respond" does not follow from trials like these. Neither does "everyone responds a little". The
74
+ data cannot separate the two.
75
+
76
+ Full tables, inputs and commands: `docs/VALIDATION.md`.
77
+
78
+ ## Generic power, known-answer test
79
+
80
+ Simulated trials with half the participants responding. Effect sizes are in SDs of a change
81
+ score. 2000 trials per cell.
82
+
83
+ | Design, n=60 | Method | Responder effect 1 SD | 2 SD | 3 SD | False-positive rate |
84
+ |---|---|---|---|---|---|
85
+ | Parallel | Variance-ratio F test | 15% | 60% | 97% | 5% |
86
+ | Parallel | Brown-Forsythe test | 13% | 60% | 97% | 4% to 5% |
87
+ | Parallel | Mixture check | 5% | 8% | 37% | 4% |
88
+ | Parallel | Moderators, if responders follow age (r=0.7) | 12% | 32% | 54% | 4% to 5% |
89
+ | Crossover | Trial data alone | none | none | none | not applicable |
90
+ | Crossover | Outside noise from 39 people | 17% | 76% | 99% | 5% to 6% |
91
+ | Crossover | Outside noise known exactly | 34% | 99% | 100% | 6% |
92
+ | Crossover | Mixture check | 5% | 14% | 62% | 4% to 5% |
93
+ | Crossover | Moderators, if responders follow age (r=0.7) | 38% | 85% | 96% | 5% |
94
+
95
+ With heavy-tailed noise and no responders at all, the false-positive rate rises to about 10% for
96
+ the F test, 9% to 12% for the known-noise crossover test, and 7% to 76% for the mixture check
97
+ (worse in larger trials). The Brown-Forsythe test and the moderator analysis stay near 5%.
98
+
99
+ ## The methods
100
+
101
+ **SD of individual response (parallel trials).** Nobody in a parallel trial is seen on both
102
+ treatments, so no individual response is ever observed. What is observed is how spread out the
103
+ changes are in each arm. If treatment adds a response that differs between people, the treated
104
+ arm is more spread out. The variance of individual response is the treated-arm variance of
105
+ change minus the control-arm variance. The tool reports its square root with a confidence
106
+ interval, the variance ratio, an F test and a Brown-Forsythe test. A negative value is reported
107
+ as negative: it means the treated arm varied less.
108
+
109
+ **Crossover trials.** Each person gives one value on treatment and one on control. The spread of
110
+ their differences is response spread plus measurement noise, added together. A plain two-period
111
+ crossover cannot separate them. A person who "did better on the drug" may have had two noisy
112
+ measurements. The tool reports what is estimable: the mean effect, the period effect, and an
113
+ upper bound on the SD of individual response. If you supply an outside test-retest noise value,
114
+ it subtracts that and reports an estimate, an interval and a test. That estimate is only as good
115
+ as the outside value. Replicated crossovers, which solve this properly, are not supported yet.
116
+
117
+ **Moderator analysis.** For each covariate named in advance (for example age, baseline latency),
118
+ one linear treatment-by-covariate interaction. P-values are corrected for the number of
119
+ moderators (Holm by default). More than three moderators are refused unless you pass
120
+ `--allow-many-moderators`. A moderator can only find responders who differ on something you
121
+ measured and named beforehand.
122
+
123
+ **Mixture check.** Fits one normal distribution and a mixture of two to the treated-arm changes
124
+ (or crossover differences), and compares them with a bootstrap likelihood-ratio test. The output
125
+ states the test's false-positive rate: 5% if the noise is normal, and a simulated rate at your
126
+ sample size if the noise is heavy-tailed. This is the weakest and most fragile method here. It is
127
+ included because fitting "responder" clusters is common, and its error rates should be seen.
128
+
129
+ ## Use
130
+
131
+ ```
132
+ pip install repairsplit
133
+
134
+ # a simulated trial with a known answer
135
+ repairsplit simulate --design parallel --n 60 --responder-share 0.5 --responder-effect -8 \
136
+ --between-sd 11 --noise-sd 2.8 --baseline-mean 125 --seed 1 --out trial.csv
137
+
138
+ repairsplit analyze trial.csv --moderators age baseline
139
+
140
+ # crossover, with an outside test-retest SD of differences
141
+ repairsplit analyze crossover.csv --retest-sd-diff 3.85 --retest-df 38
142
+ ```
143
+
144
+ Input is one tidy CSV: `participant`, `arm` or `sequence`, `period`, `baseline`, `outcome`, and
145
+ any covariates. See `docs/DATA_FORMAT.md`. Add `--json` for machine-readable
146
+ output.
147
+
148
+ ## Which inputs were assumptions
149
+
150
+ Every trial number was read from a source fetched on 2026-11-23 and is listed with its source in
151
+ `docs/VALIDATION.md`. These were not published and were assumed, with a sweep:
152
+
153
+ - The noise level: the SD of a change score, or of a within-person difference, per participant.
154
+ Swept from 3.85 ms to 6.5 ms, the lowest and highest published test-retest SDs for P100
155
+ latency, with the 5 ms planning value of the CCMR Two protocol in between. For CCMR Two also
156
+ 2.4 ms, a lower limit derived from its reported confidence interval. The MTR noise level was
157
+ published and needed no sweep.
158
+ - That each participant gives one independent value. The trials analysed eyes or lesions.
159
+ - The number analysed per arm in CCMR One (26 assumed) and the split of its 28 VEP participants
160
+ (14 and 14 assumed).
161
+ - No carryover in the crossover, although the trial itself reported a lasting effect.
162
+ - For the moderator rows, that responder status follows a named covariate with r = 0.7.
163
+
164
+ The CCMR Two result is known only from conference reports. No results paper was found.
165
+
166
+ ## What this does not show
167
+
168
+ - It does not show that there are no responders. It shows these designs could not have seen them.
169
+ - It does not show that everyone responds the same. Same reason.
170
+ - It does not analyse any real participant. All power figures are simulations.
171
+ - It does not say anything about any drug's benefit, safety or mechanism.
172
+ - The simulated truth is two clean groups with equal, normal noise. Real data will be messier:
173
+ graded responses, clustered eyes, dropout, carryover, noise that differs between arms. All of
174
+ these make detection harder or the tests less trustworthy, not easier.
175
+ - A larger variance in the treated arm is not proof of responders. Treatment can change
176
+ measurement noise, and floor or ceiling effects change spread.
177
+ - One published summary does hint at unequal spread: the ReBUILD registry entry reports an SD of
178
+ change of 6.85 ms in clemastine periods and 3.86 ms in placebo periods, per eye. No valid test
179
+ can be run on those two numbers (same people, two eyes each, unequal periods, carryover). Only
180
+ the participant-level data could say what it means.
181
+
182
+ ## Tests
183
+
184
+ ```
185
+ ruff check .
186
+ pytest -q
187
+ ```
188
+
189
+ The test suite includes small known-answer runs: false-positive rates near 5%, high power for a
190
+ large split in a large trial, low power for a small split in a small trial.
191
+
192
+ ## Credits for the methods
193
+
194
+ Each of these was looked up on 2026-11-23. For papers behind a paywall only the abstract or the
195
+ bibliographic record was read.
196
+
197
+ - SD of individual response from the difference in change-score variances: Atkinson G, Batterham
198
+ AM. True and false interindividual differences in the physiological response to an
199
+ intervention. Exp Physiol 2015;100:577-588. doi:10.1113/EP085070. Hopkins WG. Individual
200
+ responses made easy. J Appl Physiol 2015;118:1444-1446. doi:10.1152/japplphysiol.00098.2015.
201
+ - Why crossovers confound individual response with noise, and variance components generally:
202
+ Senn S. Individual therapy: new dawn or false dawn? Drug Inf J 2001;35:1479-1494.
203
+ doi:10.1177/009286150103500443. Senn S. Mastering variation: variance components and
204
+ personalised medicine. Stat Med 2016;35:966-977. doi:10.1002/sim.6739.
205
+ - Comparing variances between trial arms to detect varying effects: Mills HL et al. Detecting
206
+ heterogeneity of intervention effects using analysis and meta-analysis of differences in
207
+ variance between trial arms. Epidemiology 2021;32:846-854. doi:10.1097/EDE.0000000000001401.
208
+ Winkelbeiner S et al. Evaluation of differences in individual treatment response in
209
+ schizophrenia spectrum disorders. JAMA Psychiatry 2019;76:1063-1073.
210
+ doi:10.1001/jamapsychiatry.2019.1530.
211
+ - Robust test for equal variances: Brown MB, Forsythe AB. Robust tests for the equality of
212
+ variances. J Am Stat Assoc 1974;69:364-367. doi:10.1080/01621459.1974.10482955.
213
+ - Bootstrap likelihood-ratio test for the number of mixture components: McLachlan GJ. On
214
+ bootstrapping the likelihood ratio test statistic for the number of components in a normal
215
+ mixture. Appl Stat 1987;36(3):318. doi:10.2307/2347790.
216
+ - Multiplicity correction: Holm S. A simple sequentially rejective multiple test procedure.
217
+ Scand J Stat 1979;6:65-70. JSTOR 4615733.
218
+
219
+ Trial sources are cited in `docs/VALIDATION.md`. Article metadata and
220
+ abstracts came from PubMed; open full texts came from PubMed Central.
221
+
222
+ ## Licence
223
+
224
+ MIT. Copyright (c) 2026 Cedric Conday.
@@ -0,0 +1,206 @@
1
+ # RepairSplit
2
+
3
+ Statistics for one question about small trials of myelin repair in multiple sclerosis.
4
+
5
+ Nothing here is medical advice. It describes trial statistics, not people, and it says nothing
6
+ about whether anyone should take any drug.
7
+
8
+ ## The question
9
+
10
+ A trial reports that a drug shortened visual evoked potential latency by a millisecond or two on
11
+ average. Did some participants respond and others not? Or did everyone shift a little?
12
+
13
+ The average cannot tell. Both stories give the same average.
14
+
15
+ The trials are small, about 50 to 70 people. They measure a continuous outcome: mainly P100
16
+ latency in milliseconds, also MRI values per lesion. They are either two-arm parallel trials or
17
+ two-period crossovers.
18
+
19
+ No participant-level data from these trials is public. It is available on request only (see
20
+ `docs/DATA_ACCESS.md`). So this version contains:
21
+
22
+ 1. the methods;
23
+ 2. proof on simulated trials where the answer is known;
24
+ 3. a statement of what each published trial design could and could not have detected.
25
+
26
+ It has not been run on real trial data.
27
+
28
+ ## The headline
29
+
30
+ **Trials of this size cannot tell responders from a uniform shift at the effect sizes they
31
+ reported.**
32
+
33
+ Each row takes a published trial design and asks: suppose half the participants got twice the
34
+ reported mean effect and the other half got nothing. How often would each method notice? The
35
+ range is over the assumed noise level, which is not published (see below). The last column is
36
+ how often the same methods fire when everyone truly shifts by the same amount.
37
+
38
+ | Trial design | Reported mean effect | Variance test | Mixture check | False-positive rate |
39
+ |---|---|---|---|---|
40
+ | Clemastine crossover (ReBUILD), 50 people, trial data alone | 1.7 ms | **no test possible** | 5% | 5% to 6% |
41
+ | Same, with an outside test-retest noise estimate from 39 people | 1.7 ms | 7% to 14% | 5% | 5% to 6% |
42
+ | Same, noise known exactly (best case) | 1.7 ms | 10% to 23% | 5% | 5% to 6% |
43
+ | Bexarotene (CCMR One), 26 per arm, lesional MTR | 0.16 pu | 5% to 6% | 4% | 4% to 5% |
44
+ | Bexarotene (CCMR One), 28 people with delayed VEP | 4.06 ms | 12% to 36% | 6% to 7% | 4% to 6% |
45
+ | Metformin plus clemastine (CCMR Two), 33 and 34 | 1.2 ms | 5% to 16% | 5% to 6% | 4% to 6% |
46
+
47
+ A power of 5% is the same as the false-positive rate. It means the method sees nothing.
48
+
49
+ To reach 80% power on a half split, responders would have to improve by 2 to 3.5 times the SD of
50
+ a change score. At an SD of 5 ms that is 10 to 17.5 ms in the responders. The reported mean
51
+ effects are 1.2 to 4.1 ms.
52
+
53
+ In plain words: these trials were built to detect an average effect, and some did. They were not
54
+ built to say who responded, and they cannot. A statement such as "about half of patients
55
+ respond" does not follow from trials like these. Neither does "everyone responds a little". The
56
+ data cannot separate the two.
57
+
58
+ Full tables, inputs and commands: `docs/VALIDATION.md`.
59
+
60
+ ## Generic power, known-answer test
61
+
62
+ Simulated trials with half the participants responding. Effect sizes are in SDs of a change
63
+ score. 2000 trials per cell.
64
+
65
+ | Design, n=60 | Method | Responder effect 1 SD | 2 SD | 3 SD | False-positive rate |
66
+ |---|---|---|---|---|---|
67
+ | Parallel | Variance-ratio F test | 15% | 60% | 97% | 5% |
68
+ | Parallel | Brown-Forsythe test | 13% | 60% | 97% | 4% to 5% |
69
+ | Parallel | Mixture check | 5% | 8% | 37% | 4% |
70
+ | Parallel | Moderators, if responders follow age (r=0.7) | 12% | 32% | 54% | 4% to 5% |
71
+ | Crossover | Trial data alone | none | none | none | not applicable |
72
+ | Crossover | Outside noise from 39 people | 17% | 76% | 99% | 5% to 6% |
73
+ | Crossover | Outside noise known exactly | 34% | 99% | 100% | 6% |
74
+ | Crossover | Mixture check | 5% | 14% | 62% | 4% to 5% |
75
+ | Crossover | Moderators, if responders follow age (r=0.7) | 38% | 85% | 96% | 5% |
76
+
77
+ With heavy-tailed noise and no responders at all, the false-positive rate rises to about 10% for
78
+ the F test, 9% to 12% for the known-noise crossover test, and 7% to 76% for the mixture check
79
+ (worse in larger trials). The Brown-Forsythe test and the moderator analysis stay near 5%.
80
+
81
+ ## The methods
82
+
83
+ **SD of individual response (parallel trials).** Nobody in a parallel trial is seen on both
84
+ treatments, so no individual response is ever observed. What is observed is how spread out the
85
+ changes are in each arm. If treatment adds a response that differs between people, the treated
86
+ arm is more spread out. The variance of individual response is the treated-arm variance of
87
+ change minus the control-arm variance. The tool reports its square root with a confidence
88
+ interval, the variance ratio, an F test and a Brown-Forsythe test. A negative value is reported
89
+ as negative: it means the treated arm varied less.
90
+
91
+ **Crossover trials.** Each person gives one value on treatment and one on control. The spread of
92
+ their differences is response spread plus measurement noise, added together. A plain two-period
93
+ crossover cannot separate them. A person who "did better on the drug" may have had two noisy
94
+ measurements. The tool reports what is estimable: the mean effect, the period effect, and an
95
+ upper bound on the SD of individual response. If you supply an outside test-retest noise value,
96
+ it subtracts that and reports an estimate, an interval and a test. That estimate is only as good
97
+ as the outside value. Replicated crossovers, which solve this properly, are not supported yet.
98
+
99
+ **Moderator analysis.** For each covariate named in advance (for example age, baseline latency),
100
+ one linear treatment-by-covariate interaction. P-values are corrected for the number of
101
+ moderators (Holm by default). More than three moderators are refused unless you pass
102
+ `--allow-many-moderators`. A moderator can only find responders who differ on something you
103
+ measured and named beforehand.
104
+
105
+ **Mixture check.** Fits one normal distribution and a mixture of two to the treated-arm changes
106
+ (or crossover differences), and compares them with a bootstrap likelihood-ratio test. The output
107
+ states the test's false-positive rate: 5% if the noise is normal, and a simulated rate at your
108
+ sample size if the noise is heavy-tailed. This is the weakest and most fragile method here. It is
109
+ included because fitting "responder" clusters is common, and its error rates should be seen.
110
+
111
+ ## Use
112
+
113
+ ```
114
+ pip install repairsplit
115
+
116
+ # a simulated trial with a known answer
117
+ repairsplit simulate --design parallel --n 60 --responder-share 0.5 --responder-effect -8 \
118
+ --between-sd 11 --noise-sd 2.8 --baseline-mean 125 --seed 1 --out trial.csv
119
+
120
+ repairsplit analyze trial.csv --moderators age baseline
121
+
122
+ # crossover, with an outside test-retest SD of differences
123
+ repairsplit analyze crossover.csv --retest-sd-diff 3.85 --retest-df 38
124
+ ```
125
+
126
+ Input is one tidy CSV: `participant`, `arm` or `sequence`, `period`, `baseline`, `outcome`, and
127
+ any covariates. See `docs/DATA_FORMAT.md`. Add `--json` for machine-readable
128
+ output.
129
+
130
+ ## Which inputs were assumptions
131
+
132
+ Every trial number was read from a source fetched on 2026-11-23 and is listed with its source in
133
+ `docs/VALIDATION.md`. These were not published and were assumed, with a sweep:
134
+
135
+ - The noise level: the SD of a change score, or of a within-person difference, per participant.
136
+ Swept from 3.85 ms to 6.5 ms, the lowest and highest published test-retest SDs for P100
137
+ latency, with the 5 ms planning value of the CCMR Two protocol in between. For CCMR Two also
138
+ 2.4 ms, a lower limit derived from its reported confidence interval. The MTR noise level was
139
+ published and needed no sweep.
140
+ - That each participant gives one independent value. The trials analysed eyes or lesions.
141
+ - The number analysed per arm in CCMR One (26 assumed) and the split of its 28 VEP participants
142
+ (14 and 14 assumed).
143
+ - No carryover in the crossover, although the trial itself reported a lasting effect.
144
+ - For the moderator rows, that responder status follows a named covariate with r = 0.7.
145
+
146
+ The CCMR Two result is known only from conference reports. No results paper was found.
147
+
148
+ ## What this does not show
149
+
150
+ - It does not show that there are no responders. It shows these designs could not have seen them.
151
+ - It does not show that everyone responds the same. Same reason.
152
+ - It does not analyse any real participant. All power figures are simulations.
153
+ - It does not say anything about any drug's benefit, safety or mechanism.
154
+ - The simulated truth is two clean groups with equal, normal noise. Real data will be messier:
155
+ graded responses, clustered eyes, dropout, carryover, noise that differs between arms. All of
156
+ these make detection harder or the tests less trustworthy, not easier.
157
+ - A larger variance in the treated arm is not proof of responders. Treatment can change
158
+ measurement noise, and floor or ceiling effects change spread.
159
+ - One published summary does hint at unequal spread: the ReBUILD registry entry reports an SD of
160
+ change of 6.85 ms in clemastine periods and 3.86 ms in placebo periods, per eye. No valid test
161
+ can be run on those two numbers (same people, two eyes each, unequal periods, carryover). Only
162
+ the participant-level data could say what it means.
163
+
164
+ ## Tests
165
+
166
+ ```
167
+ ruff check .
168
+ pytest -q
169
+ ```
170
+
171
+ The test suite includes small known-answer runs: false-positive rates near 5%, high power for a
172
+ large split in a large trial, low power for a small split in a small trial.
173
+
174
+ ## Credits for the methods
175
+
176
+ Each of these was looked up on 2026-11-23. For papers behind a paywall only the abstract or the
177
+ bibliographic record was read.
178
+
179
+ - SD of individual response from the difference in change-score variances: Atkinson G, Batterham
180
+ AM. True and false interindividual differences in the physiological response to an
181
+ intervention. Exp Physiol 2015;100:577-588. doi:10.1113/EP085070. Hopkins WG. Individual
182
+ responses made easy. J Appl Physiol 2015;118:1444-1446. doi:10.1152/japplphysiol.00098.2015.
183
+ - Why crossovers confound individual response with noise, and variance components generally:
184
+ Senn S. Individual therapy: new dawn or false dawn? Drug Inf J 2001;35:1479-1494.
185
+ doi:10.1177/009286150103500443. Senn S. Mastering variation: variance components and
186
+ personalised medicine. Stat Med 2016;35:966-977. doi:10.1002/sim.6739.
187
+ - Comparing variances between trial arms to detect varying effects: Mills HL et al. Detecting
188
+ heterogeneity of intervention effects using analysis and meta-analysis of differences in
189
+ variance between trial arms. Epidemiology 2021;32:846-854. doi:10.1097/EDE.0000000000001401.
190
+ Winkelbeiner S et al. Evaluation of differences in individual treatment response in
191
+ schizophrenia spectrum disorders. JAMA Psychiatry 2019;76:1063-1073.
192
+ doi:10.1001/jamapsychiatry.2019.1530.
193
+ - Robust test for equal variances: Brown MB, Forsythe AB. Robust tests for the equality of
194
+ variances. J Am Stat Assoc 1974;69:364-367. doi:10.1080/01621459.1974.10482955.
195
+ - Bootstrap likelihood-ratio test for the number of mixture components: McLachlan GJ. On
196
+ bootstrapping the likelihood ratio test statistic for the number of components in a normal
197
+ mixture. Appl Stat 1987;36(3):318. doi:10.2307/2347790.
198
+ - Multiplicity correction: Holm S. A simple sequentially rejective multiple test procedure.
199
+ Scand J Stat 1979;6:65-70. JSTOR 4615733.
200
+
201
+ Trial sources are cited in `docs/VALIDATION.md`. Article metadata and
202
+ abstracts came from PubMed; open full texts came from PubMed Central.
203
+
204
+ ## Licence
205
+
206
+ MIT. Copyright (c) 2026 Cedric Conday.
@@ -0,0 +1,59 @@
1
+ # Routes to participant-level data
2
+
3
+ Checked 2026-11-23. Facts only. No participant-level data from any of these trials is public.
4
+ RepairSplit has not been run on real trial data.
5
+
6
+ "Verified" means the statement was read in this check, in the source named. "Not verified" means
7
+ the source could not be reached and the entry rests on the earlier survey or on a secondary source.
8
+
9
+ ## Clemastine crossover trial (ReBUILD)
10
+
11
+ Lancet 2017;390:2481-2489. PMID 29029896. doi:10.1016/S0140-6736(17)32346-2. Registry NCT02040298.
12
+
13
+ | Item | Finding | Status |
14
+ |---|---|---|
15
+ | Route | On request to the authors. | From secondary papers, see below. |
16
+ | Registry | Record updated 2025-09-17. Summary results are posted. The record has no individual-participant-data sharing section. | Verified (ClinicalTrials.gov API). |
17
+ | Primary paper's own data-sharing statement | Not read. The publisher's page returned HTTP 403 to an automated request and the paper is not in PubMed Central. Whether the 2017 paper has a data-sharing statement at all is unknown. | Not verified. |
18
+ | Secondary paper, J Neurol Neurosurg Psychiatry 2022 (doi:10.1136/jnnp-2022-329221, PMC9984688) | "Data are available upon reasonable request." | Verified (full text). |
19
+ | Secondary paper, PNAS 2023 (doi:10.1073/pnas.2217635120, PMC10193980) | States that data tables, analysis code and scripts "have been deposited in the public repository Dryad", except information that could compromise anonymisation. The reference is a Dryad share link, deposited 2023-04-30, titled "MWF of the corpus callosum: Results from the ReBUILD trial". | Verified (full text). |
20
+ | That Dryad link | Resolves. The page says the dataset "is currently Private for Peer Review" and lists three files: `mwf_data.csv`, `mwf_pnas_code.do`, `README.md`. | Verified that the page loads and lists the files. Files were not downloaded or opened. |
21
+ | Does the Dryad deposit hold VEP latency per participant? | By its title it holds myelin water fraction data, not VEP. | Not verified; contents not opened. |
22
+ | Summary numbers usable without participant data | Registry results give mean and SD of VEP change per eye for clemastine and placebo periods (93 eyes). | Verified. Used in `docs/VALIDATION.md`. |
23
+
24
+ ## Bexarotene phase 2a (CCMR One)
25
+
26
+ Lancet Neurol 2021;20:709-720. PMID 34418398. doi:10.1016/S1474-4422(21)00179-4. Registry ISRCTN14265371.
27
+
28
+ | Item | Finding | Status |
29
+ |---|---|---|
30
+ | Route | On request to the chief investigator, with a signed data access agreement. | Verified in a secondary paper, see below. |
31
+ | Registry | Record last updated 2023-11-07. Individual-participant-data sharing statement: "Not provided at time of registration". Sharing plan field: "No". | Verified (ISRCTN API). |
32
+ | Primary paper's own data-sharing statement | Not read. The publisher's page returned HTTP 403 and the paper is not in PubMed Central. The survey's wording for this paper could not be checked against the paper itself. | Not verified. |
33
+ | Secondary paper, Brain Commun 2025 (doi:10.1093/braincomms/fcaf032, PMC11852336) | Lists de-identified participant data, the primary efficacy endpoint data set, the visual evoked potentials data set and the lesional magnetisation transfer ratio data set, with data dictionaries, as "available for researchers from our website". Access requests go to the chief investigator. "A signed data access agreement will be required and investigator support might be provided if part of an academic collaboration." | Verified (full text). |
34
+ | Follow-up paper, Mult Scler 2024 (doi:10.1177/13524585241233177, PMC11290016) | "Deidentified participant data will be made available online on publication" at a department web address. | Verified (full text). |
35
+ | That department web address | Redirects to the department home page. No dataset page is reached. | Verified (HTTP redirect followed). |
36
+ | Group website named in the CCMR Two protocol | Home page loads. Its menu has research, news and outreach pages and no data or dataset page. | Verified for the home page menu only; inner pages not read. |
37
+ | Primary endpoint data on the EudraCT site | Stated by the survey. | Not verified in this check. |
38
+ | Summary numbers usable without participant data | The abstract gives the SD of MTR change per arm (0.98 and 0.84 percentage units, 26 randomised per arm). | Verified. Used in `docs/VALIDATION.md`. |
39
+
40
+ ## Metformin plus clemastine phase 2a (CCMR Two)
41
+
42
+ Protocol: Trials 2025;26:562. PMID 41361285. doi:10.1186/s13063-025-09254-2. Registry NCT05131828.
43
+
44
+ | Item | Finding | Status |
45
+ |---|---|---|
46
+ | Route | On request to the chief investigator, with a signed data access agreement, once the results are published. | Verified in the protocol paper. |
47
+ | Registry | Record updated 2025-12-11. Plan to share individual participant data: "No". No results posted. Enrolment 70. | Verified (ClinicalTrials.gov API). |
48
+ | Protocol paper's statement | "The protocol, statistical analysis plan and the deidentified dataset for the primary and secondary outcomes (with corresponding statistical codes) will be made available with publication" from the research group's website. "A signed data access agreement will be required, and investigator support might be provided if part of an academic collaboration." | Verified (full text, PMC12683890). |
49
+ | Registry and protocol paper | They disagree: the registry says no sharing, the paper describes sharing on request. | Verified, both read. |
50
+ | Results paper | None found. A PubMed search for the trial on 2026-11-23 returned only the protocol. Results were presented at ECTRIMS 2025 (abstract 152/O133) and are known here only from conference reports. | Verified that the search returned nothing else. A paper indexed under different terms could have been missed. |
51
+ | Data available now | None. The stated route opens "with publication". | Follows from the rows above. |
52
+
53
+ ## Not checked
54
+
55
+ - Whether any of the three groups currently answers data requests, how long it takes, or what the
56
+ agreement requires. Nobody was contacted.
57
+ - Sponsor platforms (Vivli, ClinicalStudyDataRequest, YODA). None of these three trials names one.
58
+ They are academic trials; the survey found a sponsor platform route only for the opicinumab trials.
59
+ - The data-sharing statements inside the two Lancet-family primary papers, as noted above.
@@ -0,0 +1,64 @@
1
+ # Input format
2
+
3
+ `repairsplit analyze` reads one tidy CSV. One row is one outcome measurement.
4
+
5
+ | Column | Parallel trial | Crossover trial | Meaning |
6
+ |---|---|---|---|
7
+ | `participant` | required | required | Any ID. Must not identify a person. |
8
+ | `arm` | required | leave empty | Two labels. The treated arm is `treatment` unless `--treatment-label` says otherwise. |
9
+ | `sequence` | leave empty | required | `TC` = treatment in period 1, control in period 2. `CT` = the reverse. |
10
+ | `period` | optional | required | `1` or `2`. |
11
+ | `baseline` | required | optional | Value before any treatment. |
12
+ | `outcome` | required | required | Value at the end of treatment (parallel) or at the end of that period (crossover). |
13
+ | any other column | optional | optional | Numeric covariates, usable as moderators by name (for example `age`). |
14
+
15
+ Rules:
16
+
17
+ - Parallel: one row per participant. The analysed value is the change score, `outcome - baseline`.
18
+ - Crossover: two rows per participant, one per period. The analysed value is the within-person
19
+ difference, treated outcome minus control outcome. `baseline` is not used for that difference,
20
+ but it can be named as a moderator. Covariates are read from the participant's first row.
21
+ - The design is detected from the columns: a filled `sequence` column means crossover, otherwise
22
+ a filled `arm` column means parallel. `--design` overrides this.
23
+ - One value per participant and visit. If the outcome is measured per eye or per lesion, reduce it
24
+ to one number per participant first (for example the mean over eligible eyes). The methods assume
25
+ independent participants. Rows from the same person are not independent.
26
+ - Participants with a missing `baseline` or `outcome` (parallel) or a missing period (crossover)
27
+ are dropped. Nothing is imputed.
28
+ - Replicated crossovers (more than two periods) are not supported in this version.
29
+ - Units are up to you. All spreads are reported in the units of `outcome`.
30
+
31
+ `repairsplit simulate` writes this layout, plus a `true_responder` column that holds the known
32
+ answer. `analyze` ignores that column unless you name it as a moderator, which you should not.
33
+
34
+ ## Example, parallel
35
+
36
+ ```
37
+ participant,arm,sequence,period,baseline,outcome,age
38
+ P0001,treatment,,1,131.2,124.9,44
39
+ P0002,control,,1,127.5,128.1,39
40
+ ```
41
+
42
+ ## Example, crossover
43
+
44
+ ```
45
+ participant,arm,sequence,period,baseline,outcome,age
46
+ P0001,,TC,1,131.2,125.0,44
47
+ P0001,,TC,2,131.2,130.4,44
48
+ P0002,,CT,1,127.5,128.3,39
49
+ P0002,,CT,2,127.5,126.9,39
50
+ ```
51
+
52
+ ## Outside test-retest noise (crossover only)
53
+
54
+ A two-period crossover cannot separate individual response from measurement noise. If a
55
+ test-retest study of the same measurement exists, pass its result:
56
+
57
+ - `--retest-sd-diff X`: SD of the difference between two measurements on the same untreated
58
+ person. Or `--retest-sd-within X`: SD of a single measurement around the person's own level
59
+ (the tool multiplies by the square root of 2).
60
+ - `--retest-df N`: people in that study minus one. Without it the noise is treated as known
61
+ exactly, which makes the result look more certain than it is.
62
+
63
+ The time gap, equipment and kind of patient in the outside study should match the trial. If they
64
+ do not, the subtraction is not valid and the tool cannot tell.