# Statistical Analysis Report: [Your study question or client project]

> A complete statistical analysis report for a thesis results chapter or a client deliverable. It walks from a
> plain-language summary through the question, data and methods, descriptive results, the main analysis with tables
> and a figure, assumption checks, sensitivity analyses, interpretation and limitations, to a reproducibility appendix
> and a reviewer checklist. The fully filled Lakemoor University example shows what each section should contain and
> how much to write, and every number in it comes from the R and Python code in the appendix, so you can rerun it and
> compare. The worked examples use fictional data; replace them with your own. Source basis: APA JARS-Quant reporting
> standards (by name), the ASA Statement on p-values and standard methods papers, written in original words.

<!--
Guidance: How to use this template
- Write the report from the approved analysis plan (academic/stats-analysis-plan). The plan says what is primary;
  the report must keep that order even when a secondary or sensitivity result looks more interesting.
- Work section by section. Each section shows the filled Lakemoor University example, marked *Example:*; replace it
  with your own text, keeping the structure and the level of detail.
- Run the appendix code first, paste your own output into the appendix, then copy numbers into the text. Never type a
  number into the text that is not in the output.
- Write the executive summary last, for a reader who will read nothing else.
- Use the reviewer checklist before sending the report to a supervisor or client. Then do Example B, Exercise C and the
  self-test.
- Related templates: academic/stats-analysis-plan, academic/stats-results-reporting, academic/stats-eda-report,
  academic/stats-ancova, academic/stats-t-tests, academic/stats-assumption-checklist,
  academic/stats-regression-model-report, academic/stats-effect-sizes, academic/stats-data-cleaning-log,
  academic/thesis-full, academic/replication-package-readme, science/reproducibility-checklist.
-->

## Document control

<!-- Guidance: Identify the report, the data version and the software, so that a reader can match the report to the exact code and data that produced it. -->

This table identifies the report, the data version it analyses and the software that produced every number.

| Field | Value |
|---|---|
| Course or project | [MSc thesis chapter 4 / client report for ...] |
| Learner or analyst | [Your name], reviewer [Supervisor or second analyst] |
| Data set | [*Example:* Lakemoor University STAT 101 homework study, autumn term (fictional), 36 students, data lock YYYY-MM-DD] |
| Analysis plan | [*Example:* SAP version 1.0, approved YYYY-MM-DD] |
| Software and versions | R 4.5.1 with car 3.1.5; Python 3.14, numpy 2.5.4, pandas 3.1.0, scipy 1.18.1, statsmodels 0.15.0 |
| Date | YYYY-MM-DD |
| Version | [1.0] |

## Executive summary

<!-- Guidance: Five to eight sentences in plain language: the question, what was done, the main estimate with its uncertainty, what it means, and the main caveat. No jargon, no p-value without an effect. -->

Write this for a reader who will read nothing else: a dean, a client, an examiner skimming the chapter. State the
question, the answer as a number with its uncertainty, what it means in practice and the most important caveat.

*Example:* Lakemoor University's Statistics department asked whether a redesigned online homework system raises final
exam scores in STAT 101. We compared 18 students in a section that used the new system with 18 students in a section
that used the old one, allowing for each student's maths placement score, because the new-system section started
with weaker placement scores. After that allowance, students using the new system scored on average 3.6 points higher
(out of 100), but the plausible range runs from 2.5 points lower to 9.6 points higher, so the data cannot rule out no
benefit. One student who left the exam early through illness strongly influences the result: without that student the
estimated benefit is 5.5 points (from 1.4 to 9.6). Because sections were not randomly assigned and the study is small,
we recommend a randomised comparison across all sections next term before a decision to adopt the system.

## Question and context

<!-- Guidance: State the question as it appears in the plan, the decision it informs, and the primary estimand in one sentence. -->

Give the research question, why it matters, the decision or theory it informs, and the primary estimand from the
analysis plan in one precise sentence.

*Example:* Does the new homework system improve STAT 101 final exam scores compared with the old system? The department
will decide whether to license the system for all sections. Primary estimand: the difference in mean final exam score
(new minus old), adjusted for maths placement score, among STAT 101 students in the autumn term.

## Data and methods

<!-- Guidance: Describe the design, the sample and its flow, the measures, and every analysis, in the order of the plan. Someone should be able to reproduce the analysis from this section and the appendix. -->

Describe the design (how units came to be in each group), the sample and exclusions, the measures and how they were
scored, and each analysis with its software. Separate primary, secondary and sensitivity analyses, and say which were
pre-specified.

*Example:*

- **Design.** Observational comparison of two existing sections taught by the same lecturer with the same lectures and
  exam. Sections were assigned to systems by timetable (not at random): section 1 kept the old system, section 2 used
  the new one.
- **Sample.** All 36 enrolled students (18 per section) sat the exam; no exclusions. One student in the new-system
  section (row 25) left the exam after 40 minutes due to illness, documented in the data cleaning log; per the plan the
  score stays in the primary analysis.
- **Measures.** Outcome: final exam score, 0 to 100, marked blind to section. Covariate: maths placement test score,
  0 to 100, taken in week 1.
- **Primary analysis.** Analysis of covariance (ANCOVA): linear regression of exam score on section (reference: old)
  and placement score, reporting the adjusted difference with a 95% CI. α = 0.05, two-sided.
- **Secondary analysis.** Unadjusted Welch t-test (Welch 1947) of exam score.
- **Assumption checks (pre-specified).** Residual normality (Q-Q plot, Shapiro-Wilk), equal residual variance by
  section (Levene, median-centred), equal slopes (section by placement interaction), influence (Cook's distance > 4/n).
- **Sensitivity analyses (pre-specified).** S1: exclude points with Cook's distance > 4/n. S2: HC3 robust standard
  errors. S3: Mann-Whitney U test of exam score (Mann and Whitney 1947).
- **Software.** R 4.5.1 (stats, car) with a parallel Python 3.14 implementation (scipy, statsmodels); both give the
  same results (appendix).

The model for the primary analysis is

$$
\text{Exam}_i = \beta_0 + \beta_1\,\text{New}_i + \beta_2\,\text{Placement}_i + \varepsilon_i,
\qquad \varepsilon_i \sim N(0, \sigma^2),
$$

where $\beta_1$ is the adjusted difference in mean exam score (new minus old) at any fixed placement score.

## Descriptive results

<!-- Guidance: Report the sample by group with n, mean, SD and median for every variable in the main analysis, before any inference. Comment on baseline differences in words, not with p-values. -->

Describe the sample before testing anything: group sizes, centre and spread of every analysed variable, and any
baseline imbalance in words. In a non-randomised comparison, baseline imbalance is the reason for adjustment.

| Variable | Section | n | Mean | SD | Median |
|---|---|---|---|---|---|
| *Example:* Placement (0 to 100) | Old system | 18 | 64.33 | 10.66 | 62.0 |
| *Example:* Placement (0 to 100) | New system | 18 | 55.83 | 10.38 | 56.5 |
| *Example:* Exam (0 to 100) | Old system | 18 | 69.39 | 10.18 | 71.0 |
| *Example:* Exam (0 to 100) | New system | 18 | 66.06 | 13.18 | 68.0 |

*Example:* The new-system section started 8.5 placement points lower than the old-system section. Placement strongly
predicts exam score (Pearson *r* = .72 across all 36 students), so a raw comparison of exam means would mix the effect
of the system with the difference in starting ability. The figure shows each student, with a least-squares line per
section: at any given placement score, new-system students tend to sit above the old-system line, apart from one
low point (placement 55, exam 31).

```vega-lite
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Final exam score by maths placement score and homework system, STAT 101, Lakemoor University (fictional)",
  "width": 380,
  "height": 260,
  "data": {"values": [
    {"section": "Old system", "placement": 52, "exam": 65}, {"section": "Old system", "placement": 78, "exam": 73},
    {"section": "Old system", "placement": 81, "exam": 74}, {"section": "Old system", "placement": 62, "exam": 76},
    {"section": "Old system", "placement": 53, "exam": 63}, {"section": "Old system", "placement": 56, "exam": 59},
    {"section": "Old system", "placement": 61, "exam": 63}, {"section": "Old system", "placement": 51, "exam": 50},
    {"section": "Old system", "placement": 84, "exam": 90}, {"section": "Old system", "placement": 65, "exam": 70},
    {"section": "Old system", "placement": 72, "exam": 80}, {"section": "Old system", "placement": 68, "exam": 79},
    {"section": "Old system", "placement": 73, "exam": 72}, {"section": "Old system", "placement": 62, "exam": 74},
    {"section": "Old system", "placement": 55, "exam": 64}, {"section": "Old system", "placement": 75, "exam": 80},
    {"section": "Old system", "placement": 57, "exam": 53}, {"section": "Old system", "placement": 53, "exam": 64},
    {"section": "New system", "placement": 59, "exam": 73}, {"section": "New system", "placement": 56, "exam": 69},
    {"section": "New system", "placement": 62, "exam": 64}, {"section": "New system", "placement": 57, "exam": 72},
    {"section": "New system", "placement": 59, "exam": 66}, {"section": "New system", "placement": 54, "exam": 74},
    {"section": "New system", "placement": 55, "exam": 31}, {"section": "New system", "placement": 62, "exam": 82},
    {"section": "New system", "placement": 80, "exam": 85}, {"section": "New system", "placement": 47, "exam": 66},
    {"section": "New system", "placement": 38, "exam": 49}, {"section": "New system", "placement": 60, "exam": 70},
    {"section": "New system", "placement": 71, "exam": 82}, {"section": "New system", "placement": 58, "exam": 70},
    {"section": "New system", "placement": 38, "exam": 53}, {"section": "New system", "placement": 53, "exam": 67},
    {"section": "New system", "placement": 53, "exam": 64}, {"section": "New system", "placement": 43, "exam": 52}
  ]},
  "encoding": {
    "x": {"field": "placement", "type": "quantitative", "title": "Maths placement score", "scale": {"domain": [30, 90]}},
    "y": {"field": "exam", "type": "quantitative", "title": "Final exam score", "scale": {"domain": [25, 95]}},
    "color": {"field": "section", "type": "nominal", "title": "Homework system"}
  },
  "layer": [
    {"mark": {"type": "point", "filled": true, "size": 50}},
    {
      "transform": [{"regression": "exam", "on": "placement", "groupby": ["section"]}],
      "mark": {"type": "line"}
    }
  ]
}
```

## Main analyses

<!-- Guidance: Report the primary analysis first, as the plan defined it, with the estimate, its CI, the test and an effect size. Then secondary analyses. Use a table for models with more than one coefficient. -->

Report the primary analysis first, exactly as pre-specified, then secondary analyses. For each: the estimate in the
units of the outcome, its 95% CI, the test statistic with df and p, and a standardised effect size where it helps.

*Example, primary analysis (ANCOVA).*

| Term | Estimate | SE | *t*(33) | *p* | 95% CI |
|---|---|---|---|---|---|
| *Example:* Intercept | 17.13 | 8.83 | 1.94 | .061 | [-0.83, 35.10] |
| *Example:* New system (vs old) | 3.57 | 2.97 | 1.20 | .237 | [-2.46, 9.60] |
| *Example:* Placement (per point) | 0.81 | 0.13 | 6.07 | < .001 | [0.54, 1.08] |

Model fit: $R^2$ = .537, residual SD = 8.22, *F*(2, 33) = 19.14, *p* < .001. Adjusted means at the mean placement
score (60.08): old system 65.94, 95% CI [61.83, 70.04]; new system 69.51, 95% CI [65.40, 73.61]. Standardised adjusted
difference: 3.57 / 11.77 (pooled SD of exam) = 0.30.

*Example report sentence:* "After adjusting for maths placement, students using the new homework system scored
3.57 points higher on the final exam than students using the old system, 95% CI [-2.46, 9.60], *t*(33) = 1.20,
*p* = .237, standardised difference 0.30."

*Example, secondary analysis (unadjusted).* Without adjustment the new-system section scored 3.33 points *lower*,
95% CI [-11.33, 4.66], Welch *t*(31.96) = -0.85, *p* = .402, Cohen's *d* = -0.28. The sign flips because the
new-system section had lower placement scores: this is why the plan made the adjusted analysis primary.

## Assumption checks

<!-- Guidance: Report each pre-specified check with its result and the action the plan prescribed. Do not add or drop checks because of what they show. -->

Report every check the plan named, its result, and the action the plan prescribed. A check that fails is a finding,
not an embarrassment: say what it means for the conclusion.

| Assumption | Check | Result | Action |
|---|---|---|---|
| *Example:* Equal slopes | Section by placement interaction | *F*(1, 32) = 0.12, *p* = .737; separate slopes 0.77 (old) and 0.86 (new) | Keep parallel-slopes model |
| *Example:* Equal residual variance | Levene (median) on residuals by section | *F*(1, 34) = 0.04, *p* = .852 | None needed |
| *Example:* Normal residuals | Q-Q plot; Shapiro-Wilk | *W* = 0.81, *p* < .001; one large negative residual (-34.4) | Driven by row 25; see S1 and S3 |
| *Example:* Influence | Cook's distance | Max 0.365 at row 25 (threshold 4/36 = 0.111); standardised residual -4.31 | Sensitivity S1 |
| *Example:* Independence | Design | One exam per student; same lecturer and exam | Acceptable; clustering by section noted in limitations |

The conclusion from the checks is clear: the model fits the bulk of the data well, and one student's score is far
below what placement predicts. That score is genuine (the student was ill), so it is not an error to delete; it is an
influential observation whose effect must be shown.

## Sensitivity analyses

<!-- Guidance: Show each pre-specified sensitivity analysis next to the primary result, in one table, and say in one sentence whether the conclusion changes. -->

Put the primary result and every sensitivity analysis in one table, so the reader sees at once whether the conclusion
depends on an assumption.

| Analysis | Estimate (new minus old) | 95% CI | *p* |
|---|---|---|---|
| *Example:* Primary ANCOVA, all 36 | 3.57 | [-2.46, 9.60] | .237 |
| *Example:* S1: ANCOVA without row 25 (n = 35) | 5.53 | [1.42, 9.63] | .010 |
| *Example:* S2: ANCOVA with HC3 robust SE | 3.57 (SE 2.87) | not computed | .222 |
| *Example:* S3: Mann-Whitney U (unadjusted) | *U* = 177.5 | not applicable | .635 |

*Example:* The direction of the adjusted effect is stable (positive in S1 and S2), but its statistical clarity depends
on one student: with that student excluded the 95% CI excludes zero. S3 ignores placement and therefore answers the
unadjusted question; it agrees with the unadjusted t-test. The primary result stands as the pre-specified answer, and
S1 is reported as a sensitivity result, not as a replacement.

## Interpretation

<!-- Guidance: Answer the question in words, with the estimate and its uncertainty. Separate what the data show from what you believe. Avoid "proves" and "no effect". -->

Answer the question directly, using the estimate and the interval rather than the p-value alone. A non-significant
result is not evidence of no effect when the interval includes practically important values; a significant one is not
evidence of an important effect when the interval includes trivial values (see the ASA Statement on p-values,
Wasserstein and Lazar 2016).

*Example:* The best estimate is a benefit of about 3.6 exam points for students of equal placement, and values from a
loss of 2.5 points to a gain of 9.6 points are compatible with the data. The department set 5 points as the gain that
would justify the licence; the interval includes both zero and values above 5, so this study cannot settle the
question either way. The sensitivity result (5.5 points without the ill student) points the same way and suggests the
uncertainty is inflated by one unusual score, but it was not the pre-specified analysis.

## Limitations

<!-- Guidance: List the limitations that could change the conclusion, most serious first, and say in which direction each could bias the estimate. -->

List limitations that could change the conclusion, the most serious first, and for each say how it could bias the
estimate.

*Example:*

1. **No randomisation.** Sections differ in timetable and possibly in motivation; placement adjustment removes only
   the measured part of that difference. The estimate could be biased in either direction.
2. **Two sections.** System and section are fully confounded: any section-level factor (time of day, peer group) is
   indistinguishable from the system effect, and the 36 students are not 36 independent replications of the system.
3. **Small sample.** With 18 per group the study has low power for a 5-point effect, so a null result was likely
   even if the system works.
4. **One influential observation.** The conclusion's clarity depends on one student; see sensitivity S1.
5. **One term, one course.** Results may not transfer to other courses or student groups.

## Reproducibility appendix

<!-- Guidance: Include everything needed to reproduce every number: software and versions, the data or how to obtain it, the full code, and any seeds. Paste real output. -->

Give the software and versions, the data (or the path and checksum of the locked file), the complete code, and the
seed of any random process. This example uses no random numbers; if you add a bootstrap or multiple imputation, set
and report the seed. For a full replication package see academic/replication-package-readme.

*Example:* Software: R 4.5.1 with car 3.1.5; Python 3.14 with numpy 2.5.4, pandas 3.1.0, scipy 1.18.1, statsmodels
0.15.0. Data: typed inline below (36 rows). Seeds: none required. The R output below is **abridged**: it keeps
only the lines the report uses, and some printed tables are condensed onto one labelled line, but every number is
copied exactly from the run. The Python block prints its lines in exactly the form shown. Run the code to see the full
output.

```r
library(car)   # install.packages("car") once: leveneTest, hccm
d <- data.frame(
  section = factor(rep(c("old", "new"), each = 18), levels = c("old", "new")),
  placement = c(52, 78, 81, 62, 53, 56, 61, 51, 84, 65, 72, 68, 73, 62, 55, 75, 57, 53,
                59, 56, 62, 57, 59, 54, 55, 62, 80, 47, 38, 60, 71, 58, 38, 53, 53, 43),
  exam      = c(65, 73, 74, 76, 63, 59, 63, 50, 90, 70, 80, 79, 72, 74, 64, 80, 53, 64,
                73, 69, 64, 72, 66, 74, 31, 82, 85, 66, 49, 70, 82, 70, 53, 67, 64, 52))
agg <- function(x) c(n = length(x), mean = mean(x), sd = sd(x), median = median(x))
round(t(sapply(split(d$exam, d$section), agg)), 2)
t.test(exam ~ section, data = d)                       # Welch is R's default
fit <- lm(exam ~ section + placement, data = d)        # primary ANCOVA
summary(fit); confint(fit)
shapiro.test(resid(fit))
leveneTest(resid(fit) ~ d$section)
anova(fit, lm(exam ~ section * placement, data = d))   # equal slopes
which.max(cooks.distance(fit)); max(cooks.distance(fit))
rstandard(fit)[25]                                     # standardised residual
s1 <- lm(exam ~ section + placement, data = d[-25, ])  # S1
coef(summary(s1))["sectionnew", ]; confint(s1)["sectionnew", ]
hc3 <- sqrt(diag(hccm(fit, type = "hc3")))              # S2
hc3[2]; coef(fit)[2] / hc3[2]
2 * pt(-abs(coef(fit)[2] / hc3[2]), df = 33)
wilcox.test(exam ~ section, data = d, exact = FALSE)   # S3
predict(fit, data.frame(section = c("old", "new"), placement = mean(d$placement)),
        interval = "confidence")
```

```text
Abridged R output (numbers exact; layout condensed)
Welch Two Sample t-test: t = 0.84952, df = 31.959, p-value = 0.4019
95 percent confidence interval: -4.659576 11.326243   (old minus new)

            Estimate Std. Error t value Pr(>|t|)
(Intercept)  17.1321     8.8294   1.940   0.0609
sectionnew    3.5711     2.9657   1.204   0.2371
placement     0.8123     0.1339   6.066 7.94e-07
Residual standard error: 8.216 on 33 degrees of freedom
Multiple R-squared:  0.537,  F-statistic: 19.14 on 2 and 33 DF,  p-value: 3.03e-06
sectionnew CI: -2.463  9.605

Shapiro-Wilk: W = 0.8096, p-value = 2.54e-05
Levene (center = median): F = 0.0354, Pr(>F) = 0.8519
Equal slopes: F = 0.1151, Pr(>F) = 0.7366
max Cook's D 0.365 at row 25, standardised residual -4.306
S1 without row 25: estimate 5.525, SE 2.016, t 2.740, p 0.00996, CI 1.418 9.633
S2 HC3 SE 2.868, t 1.245, p 0.222
S3 Wilcoxon rank sum: W = 177.5, p-value = 0.6345
Adjusted means: old 65.94 [61.83, 70.04], new 69.51 [65.40, 73.61]
```

```python
import numpy as np
import pandas as pd
import scipy.stats as st
import statsmodels.formula.api as smf
from statsmodels.stats.anova import anova_lm

d = pd.DataFrame({
    "section": ["old"] * 18 + ["new"] * 18,
    "placement": [52, 78, 81, 62, 53, 56, 61, 51, 84, 65, 72, 68, 73, 62, 55, 75, 57, 53,
                  59, 56, 62, 57, 59, 54, 55, 62, 80, 47, 38, 60, 71, 58, 38, 53, 53, 43],
    "exam": [65, 73, 74, 76, 63, 59, 63, 50, 90, 70, 80, 79, 72, 74, 64, 80, 53, 64,
             73, 69, 64, 72, 66, 74, 31, 82, 85, 66, 49, 70, 82, 70, 53, 67, 64, 52]})
old, new = d.exam[d.section == "old"], d.exam[d.section == "new"]
w = st.ttest_ind(old, new, equal_var=False)           # Welch must be asked for
pooled = st.ttest_ind(old, new)                        # scipy default: pooled
print(f"Welch: statistic={w.statistic:.4f}, pvalue={w.pvalue:.4f}, df={w.df:.4f}")
print(f"scipy default (pooled): statistic={pooled.statistic:.4f}, pvalue={pooled.pvalue:.4f}, df={pooled.df}")
f = "exam ~ C(section, Treatment('old')) + placement"
fit = smf.ols(f, data=d).fit()
print(fit.summary2().tables[1].round(4).to_string())
sw = st.shapiro(fit.resid)
print(f"Shapiro-Wilk: W = {sw.statistic:.4f}, p = {sw.pvalue:.3g}")
lev = st.levene(fit.resid[d.section == "old"], fit.resid[d.section == "new"])  # center="median"
print(f"Levene (median): F = {lev.statistic:.4f}, p = {lev.pvalue:.4f}")
slopes = anova_lm(fit, smf.ols("exam ~ C(section, Treatment('old')) * placement", data=d).fit())
print(f"Equal slopes: F = {slopes.F[1]:.6f}, Pr(>F) = {slopes['Pr(>F)'][1]:.6f}")
print("max Cook's D", fit.get_influence().cooks_distance[0].max().round(3))
s1 = smf.ols(f, data=d.drop(index=24)).fit()            # row 25 is index 24
print("S1:", s1.params.iloc[1].round(3), s1.conf_int().iloc[1].round(3).tolist())
print("S2 HC3 z p:", smf.ols(f, data=d).fit(cov_type="HC3").pvalues.iloc[1].round(3))
print("S2 HC3 t p:", smf.ols(f, data=d).fit(cov_type="HC3", use_t=True).pvalues.iloc[1].round(3))
mw = st.mannwhitneyu(old, new)
print(f"Mann-Whitney: U = {mw.statistic}, p = {mw.pvalue:.4f}")
```

```text
Welch: statistic=0.8495, pvalue=0.4019, df=31.9587
scipy default (pooled): statistic=0.8495, pvalue=0.4015, df=34.0
                                       Coef.  Std.Err.       t   P>|t|  [0.025   0.975]
Intercept                            17.1321    8.8294  1.9404  0.0609 -0.8313  35.0956
C(section, Treatment('old'))[T.new]   3.5711    2.9657  1.2041  0.2371 -2.4626   9.6047
placement                             0.8123    0.1339  6.0662  0.0000  0.5399   1.0847
Shapiro-Wilk: W = 0.8096, p = 2.54e-05
Levene (median): F = 0.0354, p = 0.8519
Equal slopes: F = 0.115137, Pr(>F) = 0.736587
max Cook's D 0.365
S1: 5.525 [1.418, 9.633]
S2 HC3 z p: 0.213
S2 HC3 t p: 0.222
Mann-Whitney: U = 177.5, p = 0.6345
```

**Where R and Python differ by design.** (1) R's `t.test` uses Welch by default; scipy's `ttest_ind` uses the pooled
test unless you pass `equal_var=False` (here *p* = .4019 vs .4015, but they can differ a lot with unequal variances).
(2) statsmodels reports HC3 p-values from the normal distribution unless you pass `use_t=True` (.213 vs .222); the
report uses the t version to match R. (3) Both tools pick the reference level alphabetically by default ("new" before
"old"); the code fixes "old" as reference in both, otherwise the sign of the estimate flips.

## Reviewer checklist

<!-- Guidance: The author ticks this before sending; the reviewer ticks it again independently. Any "no" is fixed or explained in the report. -->

Tick each item before the report leaves your desk, then ask a reviewer to tick it independently.

- [ ] The executive summary states the main estimate with its uncertainty in plain language, and the main caveat.
- [ ] The primary analysis is the one in the approved plan, reported first; any deviation is logged and explained.
- [ ] Every number in the text appears in the appendix output (spot-check five).
- [ ] Descriptives are given by group for every analysed variable, with n.
- [ ] Each estimate has units, a 95% CI, the test statistic with df, and an exact p (three decimals or < .001).
- [ ] An effect size is reported and interpreted in context, not only by a generic label.
- [ ] All pre-specified assumption checks are reported with the action taken.
- [ ] Sensitivity analyses appear next to the primary result, and the text says whether the conclusion changes.
- [ ] Non-significant results are not described as "no effect"; significant results are not described as "proof".
- [ ] Causal language matches the design (no causal claim from a non-randomised comparison without caveats).
- [ ] Limitations say in which direction each could bias the estimate.
- [ ] Software, versions, data version and seeds are listed; the code runs from a clean session.
- [ ] Figures have axis titles with units and are readable in greyscale.

## Worked example B: write up sensitivity analysis S1 (half solved)

<!-- Guidance: Fill the [ ] gaps from the appendix output only. Then compare with the Answer key. -->

Complete the paragraph that reports sensitivity analysis S1.

"Excluding the one student with Cook's distance above 4/n (row [ ], distance [ ]), the adjusted difference was
[ ] points, 95% CI [[ ], 9.63], *t*(32) = 2.74, *p* = [ ]. The direction matches the primary analysis, but unlike the
primary analysis the interval [ ] zero. Because this exclusion was [pre-specified as a sensitivity analysis / chosen
after seeing the data], it [does / does not] replace the primary result."

Explain in one sentence why the df is 32 here and 33 in the primary analysis: [ ].

## Exercise C: write the executive summary for a different result

<!-- Guidance: Write in plain language for a reader with no statistics training. Then check the Answer key for a model answer. -->

Harbour City Library ran a randomised trial of a text-message reminder on returning books on time. Primary result:
on-time return 78% with reminders vs 71% without, risk difference 7.0 percentage points, 95% CI [1.3, 12.7],
*p* = .016, n = 900 (450 per arm). A pre-specified sensitivity analysis that treats lost cards as late returns gives 6.1 points,
95% CI [0.4, 11.8]. Write a five-sentence executive summary: question, design, answer with uncertainty, meaning, caveat.

## Common mistakes and misconceptions

<!-- Guidance: Reread this list after drafting the report; each item is a frequent examiner or client comment. -->

- **Leading with the p-value.** Lead with the effect and its interval; the p-value is supporting detail.
- **"Not significant, so no effect".** Example A's interval includes a 9.6-point gain. Absence of evidence is not
  evidence of absence.
- **Swapping the primary analysis after seeing results.** Promoting S1 to primary because it is significant would be a
  forking path. Report it as sensitivity.
- **Deleting an awkward data point.** A genuine but unusual score stays in the primary analysis; show its influence.
- **Testing baseline differences and calling the groups "comparable".** Report the difference and its consequence; a
  non-significant baseline test does not prove balance.
- **Numbers that do not match the output.** Copy from the output, or generate tables by code.
- **Causal verbs for an observational comparison.** "The system raised scores" overstates a non-randomised design;
  "students using the system scored higher, after adjustment" is accurate.
- **p = 0.03 means a 3% chance that H0 is true.** It is the probability of data at least this extreme if H0 and the
  model assumptions held.

## Self-test questions

<!-- Guidance: Answer from memory, then check the Answer key. Repeat in a week. -->

1. In the example, why does the unadjusted difference have the opposite sign to the adjusted difference?
2. Which result belongs in the abstract: the primary ANCOVA or sensitivity S1? Why?
3. The Shapiro-Wilk test rejected normality. Name two appropriate responses that were pre-specified.
4. Why do scipy's `ttest_ind` and R's `t.test` give different p-values by default?
5. Rewrite this sentence correctly: "The new system had no effect (p = .237)."

## My notes and next steps

<!-- Guidance: Plan your next draft, not a summary of this one. -->

- Confidence (1 to 5): writing estimates with CIs [ ], assumption reporting [ ], sensitivity tables [ ],
  limitations [ ].
- Questions for my supervisor or client: [ ]
- Mistakes to log in academic/stats-error-log: [ ]
- Next: academic/stats-results-reporting for sentence templates; academic/replication-package-readme for the code.

## Sources and further reading

<!-- Guidance: Cite reporting standards by name; the wording in your report must be your own. -->

Structure aligned with the APA Journal Article Reporting Standards for quantitative research (JARS-Quant, by name) and
the ASA Statement on Statistical Significance and P-Values, with methods cited from their original papers; all text
and examples are original.

- Appelbaum, M., Cooper, H., Kline, R. B., Mayo-Wilson, E., Nezu, A. M., and Rao, S. M. (2018). Journal article
  reporting standards for quantitative research in psychology: The APA Publications and Communications Board task
  force report. *American Psychologist*, 73(1), 3–25.
- American Psychological Association (2020). *Publication Manual of the American Psychological Association* (7th ed.),
  by name only.
- Wasserstein, R. L., and Lazar, N. A. (2016). The ASA statement on p-values: context, process, and purpose. *The
  American Statistician*, 70(2), 129–133.
- Welch, B. L. (1947). The generalization of "Student's" problem when several different population variances are
  involved. *Biometrika*, 34(1–2), 28–35.
- Mann, H. B., and Whitney, D. R. (1947). On a test of whether one of two random variables is stochastically larger
  than the other. *Annals of Mathematical Statistics*, 18(1), 50–60.
- Shapiro, S. S., and Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). *Biometrika*,
  52(3–4), 591–611.
- Cook, R. D. (1977). Detection of influential observation in linear regression. *Technometrics*, 19(1), 15–18.
- Long, J. S., and Ervin, L. H. (2000). Using heteroscedasticity consistent standard errors in the linear regression
  model. *The American Statistician*, 54(3), 217–224.
- Further reading (by name only): de Smith, M. J. (2024). *Statistical Analysis Handbook* (2024 edition, StatsRef).

## Answer key

<!-- Guidance: Check after attempting. Log misses with the reason in your error log. -->

**Example B.** Row 25, distance 0.365; 5.53 points, 95% CI [1.42, 9.63], *p* = .010; the interval excludes zero;
pre-specified as a sensitivity analysis, so it does not replace the primary result. The df is 32 because one
observation was removed (35 students minus 3 estimated coefficients), versus 36 minus 3 = 33.

**Exercise C (model answer).** "Harbour City Library tested whether a text-message reminder helps members return
books on time. We randomly assigned 900 members to receive reminders or not. With reminders, 78% returned books on
time compared with 71% without, a gain of 7 percentage points; the true gain is plausibly between about 1 and 13
points. Even counting lost cards as late returns, the gain stays positive (about 6 points). The size of the benefit is
uncertain, so the library should weigh the messaging cost against a gain that could be as small as 1 point."

**Self-test.** (1) The new-system section had lower placement scores, and placement strongly predicts exam score;
adjustment compares students of equal placement. (2) The primary ANCOVA, because it was pre-specified; S1 is
reported alongside as a sensitivity result. (3) Showing the influence of the outlying point (S1), and a rank-based test that does
not rely on normality (S3, which answers the unadjusted question). S2 (HC3 robust SE) protects against unequal
variance, not non-normality, so it is not a response to this check. With n = 36 and a non-normality driven by one
point, the t-based inference for the coefficient is fairly robust; the influence analysis matters more.
(4) scipy defaults to the pooled-variance test, R to Welch. (5) "After adjustment, the new system was associated with
a 3.6-point higher score, 95% CI [-2.5, 9.6], *p* = .237; the data are compatible with no benefit and with a benefit
above 5 points."

## Revision history

<!-- Guidance: One row per version sent to a supervisor or client. -->

| Version | Date | Author | Change |
|---|---|---|---|
| 1.0 | YYYY-MM-DD | [Your name] | First complete draft for review |
