Skip to content

Commit 75f6fe9

Browse files
author
MohamedOmar2020
committed
Revise Concepts page: fix 7 issues from external review
1. Aggregation: acknowledge mean/median/pct_pos options, not just means 2. Multi-timepoint: distinguish two-visit DiD from event-study/trend 3. Parallel trends: "at least two pre-treatment visits" not three 4. Permutation: remove reference to unexposed utility function name 5. Small-sample guidance: soften from threshold to rule of thumb 6. muscat: acknowledge full scope (multi-sample multi-condition DS) 7. EB inflation claim: attribute to benchmark settings, not general fact
1 parent b9a0f1c commit 75f6fe9

1 file changed

Lines changed: 41 additions & 30 deletions

File tree

docs/source/concepts.rst

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ effect:
2828
balance of calibration and power
2929
(`Nature Communications <https://doi.org/10.1038/s41467-022-35519-4>`__).
3030

31-
**sctrial** addresses this by aggregating cell-level expression to
32-
participant-level pseudobulk means before applying any statistical test.
33-
The participant — not the cell — is the unit of inference throughout the
34-
package.
31+
By default, **sctrial** aggregates cell-level expression to
32+
participant-level summaries before inference, typically at the
33+
participant-visit level. Supported aggregation functions include mean,
34+
median, and percent-positive summaries. The participant — not the
35+
cell — is the recommended unit of inference throughout the package.
3536

3637
Supported study designs
3738
-----------------------
@@ -41,9 +42,14 @@ estimand:
4142

4243
**Two-arm longitudinal (Difference-in-Differences)**
4344
Participants in two arms (e.g. treatment vs control, responder vs
44-
non-responder) are measured at two or more time points. The estimand
45-
is the *interaction* between arm and time — i.e. the differential
46-
change.
45+
non-responder) are measured at two or more time points. For the
46+
canonical two-visit setting, sctrial estimates a standard pre/post DiD
47+
parameter. For studies with more than two visits, sctrial additionally
48+
provides event-study
49+
(:func:`~sctrial.stats.timeseries.event_study_did`) and
50+
trend-interaction
51+
(:func:`~sctrial.stats.timeseries.trend_interaction`) analyses to
52+
characterize time-varying differential effects.
4753

4854
**Single-arm paired**
4955
All participants receive the same intervention and are measured pre
@@ -60,7 +66,7 @@ the correct estimand is applied automatically.
6066
Difference-in-Differences estimation
6167
-------------------------------------
6268

63-
For the two-arm longitudinal case, sctrial estimates a
69+
For the two-arm, two-visit longitudinal case, sctrial estimates a
6470
Difference-in-Differences (DiD) parameter. For participant *i* in
6571
arm *a* at time *t*, the model is:
6672

@@ -98,9 +104,11 @@ The identifying assumption
98104
The key assumption for a causal interpretation of :math:`\beta_{\text{DiD}}`
99105
is **parallel trends**: in the absence of treatment, both arms would have
100106
followed the same trajectory. With only two time points, this assumption
101-
cannot be tested directly. When three or more pre-treatment observations
102-
are available, sctrial provides :func:`~sctrial.stats.timeseries.test_parallel_trends`
103-
to assess whether pre-treatment trends diverge.
107+
cannot be tested directly. When at least two pre-treatment visits are
108+
available, sctrial provides
109+
:func:`~sctrial.stats.timeseries.test_parallel_trends` to assess
110+
evidence of differential pre-treatment trends; interpretation is more
111+
informative when multiple pre-treatment intervals are observed.
104112

105113
For a formal treatment of parallel-trends testing and sensitivity
106114
analysis, see Rambachan & Roth (2023),
@@ -123,18 +131,20 @@ sctrial provides two approaches for finite-sample inference:
123131

124132
**Wild cluster bootstrap** (``use_bootstrap=True``)
125133
Resamples Rademacher weights at the participant level to construct
126-
a bootstrap-*t* distribution. Recommended for fewer than 15
127-
participants per arm. Based on the procedure described in
128-
Cameron, Gelbach & Miller (2008),
134+
a bootstrap-*t* distribution. Recommended as a small-sample
135+
safeguard, especially when the number of participants per arm is
136+
modest (e.g. fewer than ~15 per arm). Based on the procedure
137+
described in Cameron, Gelbach & Miller (2008),
129138
`Review of Economics and Statistics <https://doi.org/10.1162/rest.90.3.414>`__.
130139

131-
**Permutation testing** (``permutation_pvalue`` utility)
132-
Randomly reassigns treatment labels across participants and recomputes
133-
the test statistic under the null. Distribution-free but
134-
computationally more expensive.
140+
**Permutation testing**
141+
sctrial also supports permutation-based inference on participant-level
142+
summaries, which randomly reassigns treatment labels across
143+
participants and recomputes the test statistic under the null.
144+
Distribution-free but computationally more expensive.
135145

136-
For well-powered studies (≥ 15 participants per arm), the default
137-
cluster-robust standard errors are generally adequate.
146+
For larger and better-balanced studies, cluster-robust standard errors
147+
are often adequate, though diagnostics remain important.
138148

139149
Within-arm and cross-sectional comparisons
140150
------------------------------------------
@@ -209,8 +219,9 @@ tools:
209219

210220
- **muscat** (Crowell et al., 2020,
211221
`Nature Communications <https://doi.org/10.1038/s41467-020-19894-4>`__)
212-
provides pseudobulk DE via edgeR/limma for multi-sample multi-condition
213-
designs, primarily targeting cross-sectional contrasts.
222+
provides flexible differential-state analysis for multi-sample,
223+
multi-condition scRNA-seq data using pseudobulk and mixed-model
224+
approaches.
214225

215226
- **dreamlet** (Hoffman et al., 2023,
216227
`bioRxiv <https://doi.org/10.1101/2023.03.17.533005>`__)
@@ -221,11 +232,11 @@ tools:
221232
`Communications Biology <https://doi.org/10.1038/s42003-021-02146-6>`__)
222233
fits negative binomial mixed models directly on cell-level counts.
223234

224-
sctrial differs from these tools in three respects: (1) it explicitly
225-
targets longitudinal estimands (DiD, paired change scores) rather than
226-
cross-sectional group contrasts; (2) it estimates effects gene-by-gene
227-
without cross-gene variance borrowing, avoiding the empirical Bayes
228-
assumptions that can inflate false positives when the fraction of
229-
differentially expressed genes is high; and (3) it provides a unified
230-
interface across two-arm, single-arm, and cross-sectional designs within
231-
a single package.
235+
sctrial differs from these tools in that it centers participant-level
236+
longitudinal estimands (DiD, paired change scores) and associated
237+
diagnostics as the primary analysis target. It estimates effects
238+
gene-by-gene without cross-gene variance borrowing; in our benchmark
239+
settings, this improved calibration in mixed-signal panels with a high
240+
fraction of affected genes. It also provides a unified interface across
241+
two-arm, single-arm, and cross-sectional designs within a single
242+
package.

0 commit comments

Comments
 (0)