A pretest-posttest class study is a 2 x 2 difference-in-differences

A 2026 study of digital inquiry lessons reports four group means. We turn them into a difference-in-differences estimate and check its change scores.

Most school experiments are not randomised. Two intact classes are picked, one gets the new lessons, both are tested before and after, and the question is whether the new class moved more than the other one. That design has a name in economics: difference-in-differences (DiD), the change in the treated group minus the change in the comparison group. A 2026 paper in Frontiers in Education reports nine weeks of digitally supported inquiry lessons with 118 Kazakh primary pupils, and prints all four group means with their standard deviations and sizes, which is exactly what the difference-in-differences calculator needs. Along the way we use the effect size converter to put the result on a standard scale and the hypothesis tests page for the plain two-sample view.

The paper in brief

Two classes of grade 3 and 4 pupils (59 each) studied the same curriculum topics for nine weeks. One class worked through a structured digital inquiry cycle: form a question, search for information with guidance, organise the evidence, visualise it, present it, reflect. The other class covered the same topics in the usual way, with textbook tasks, oral questioning and written exercises. A research-competence test scored on a 1 to 4 scale was given before and after.

The digital-inquiry class moved from 2.39 to 3.27 (SD 0.61 then 0.58); the ordinary class from 2.41 to 2.58 (SD 0.63 then 0.66). The authors report a paired t of 7.18 for the first class and 1.24 for the second, an ANCOVA on the post-test controlling for the pretest with F(1, 115) = 38.64 (partial eta squared 0.25), and a gain-score comparison with t(116) = 3.86 and d = 0.71. Rubric scores on the pupils’ own research products also favoured the digital class (26 of 59 reached the advanced level against 7 of 59).

Checked with the tools

The paper never uses the phrase difference-in-differences, but its design is the textbook 2 x 2 version of it, and the four printed cells are enough to compute the estimate from scratch. This is a recomputation from the paper’s stated means, standard deviations and group sizes, not a re-analysis of pupil-level data (which is not published).

Step 1: the estimate. The digital class gained 0.88 points, the ordinary class 0.17, so the difference-in-differences is 0.71 points on the 1 to 4 scale. Put differently, the counterfactual, where the digital class would have landed had it drifted like the ordinary class, is 2.56, and the class actually reached 3.27 (Figure 1).

Research competence: the two groups before and afterResearch competence: the two groups before and after2.252.52.7533.2501Test (0 = before the nine weeks, 1 = after)Score (1 to 4 scale)Digital inquiry classOrdinary classCounterfactualfibub.com
Figure 1. The paper's four group means (dots), joined for each group, with the dashed line showing where the digital-inquiry class would have ended if it had moved like the ordinary class. The gap at the right is the difference-in-differences the tool reports.

Step 2: how certain it is. The tool’s 2 x 2 card treats the four cells as four independent samples, which gives a standard error of the square root of the sum of sd squared over n, here 0.162, with t = 4.39 on 232 degrees of freedom, p = 0.000017, and a 95 % interval of 0.39 to 1.03 points. So the sign and rough size of the effect do not depend on any of the paper’s modelling choices.

Step 3: the before-after pairing, which the 2 x 2 ignores. The same pupils were tested twice, so the four cells are not independent, and the correct standard error depends on how strongly a pupil’s two scores agree. The paper gives enough to recover that: a change of 0.88 with dz = 0.94 means the changes themselves had a standard deviation of 0.94 points (0.88 / 0.94 = 0.936), and 0.17 with dz = 0.16 gives 1.06 points. Those two numbers reproduce the paper’s own gain-score test exactly: standard error 0.184 and t = 3.85, against the published 3.86.

That is the interesting part. A change that scatters by 0.94 points, when the before and after scores each scatter by about 0.6, means the two scores disagree: the implied before-after correlation is -0.24 in the digital class and -0.36 in the ordinary class. Test scores of the same children nine weeks apart normally correlate positively, often 0.5 to 0.8. With a correlation of 0.5 the change-score standard deviation would be 0.60 and dz would be 1.48, not 0.94. Figure 2 shows how the t statistic for the same 0.71 points moves with the assumed correlation.

The same 0.71 points, with and without the pairingThe same 0.71 points, with and without the pairing02.557.510-0.4-0.200.20.40.60.8Assumed before-after correlation within a pupilt statistic for the effectp = 0.05cells treated as independentimplied by the paper (-0.24)fibub.com
Figure 2. How certain the same 0.71-point estimate is, as the assumed before-after correlation within a pupil changes. The tool's 2 x 2 card uses the left-hand case (independent cells).

So the paper’s effect is robust (every version of the test is far past p = 0.05), but its reported dz values are the most conservative reading of its own data, and probably mistaken. A reader who only had dz would understate the precision of the study.

Check Paper Our tool result
Change in the digital-inquiry class +0.88 +0.88 points
Change in the ordinary class +0.17 +0.17 points
Difference-in-differences not reported as such 0.71 points, 95 % CI 0.39 to 1.03
Standard error, cells as independent not reported 0.162, t = 4.39, p = 0.000017
Gain-score comparison t(116) = 3.86, d = 0.71 t = 3.85 from the published dz values
Implied before-after correlation not reported -0.24 (digital class), -0.36 (ordinary class)
Standardised effect, post-test only d = 0.71 d = 1.11 from the post-test means and SDs

The last row is worth a note. The paper labels the gain-score difference d = 0.71. The post-test means alone (3.27 against 2.58, pooled SD 0.62) give d = 1.11, and the ANCOVA’s partial eta squared of 0.25 converts to about d = 1.15. Three different d values for one study, all correct for the quantity they describe: this is what the effect size converter is for, and why an effect size should always say which contrast it belongs to.

How we made the graphs

Both charts and every number above come from scripts/blog-figures/primary-school-digital-inquiry-research-competence-difference-in-differences.mjs in fibub’s public code. It calls did2x2 from src/lib/sci/did.ts, the maths behind the difference-in-differences calculator, for the estimate, standard error, t, p and interval, and tTwoSided and tInv from src/lib/sci/stats.ts for the curve in Figure 2.

Every input is a value printed in the paper: the four means, the four standard deviations, the two group sizes of 59, and the two dz values used to recover the change-score standard deviations. The only thing we add is the sweep of assumed before-after correlations in Figure 2, which is a calculation, not an assumption about the study: the paper’s own figures sit at -0.24.

How we test the maths

tests/sci-tools/difference-in-differences.mjs runs on every change to fibub and pins the tool against statsmodels 0.15:

  • A 2 x 2 built from cell means 50, 57, 48 and 51 with sizes 40, 38, 45 and 44 must give a DiD of exactly 4.00, a counterfactual of 53.0, and a standard error of 2.5514 with p = 0.1189 and 163 degrees of freedom: the same numbers statsmodels produces from HC2 robust errors on individual data with those means, standard deviations and sizes.
  • On the tool’s example panel of 20 counties, the two-way fixed effects estimate must be 2.1152 with a county-clustered standard error of 0.1183, and the event-study coefficient for 2022 must be 3.1492, both matching statsmodels with cov_type='cluster'.
  • The pre-trend joint test must give F(3, 19) = 0.1616, p = 0.9209, as statsmodels’ f_test does.
  • New with this article: the four cells of this paper (2.39, 3.27, 2.41, 2.58 with SDs 0.61, 0.58, 0.63, 0.66 and n = 59 each) must give a DiD of 0.7100, a standard error of 0.16162, t = 4.3930 on 232 degrees of freedom and a 95 % interval of 0.3916 to 1.0284.

Check it yourself

On the difference-in-differences page:

  1. In What do you have? choose Group means.
  2. Fill the four rows of the table. Treated, before: mean 2.39, SD 0.61, size n 59. Treated, after: 3.27, 0.58, 59. Comparison, before: 2.41, 0.63, 59. Comparison, after: 2.58, 0.66, 59.
  3. Leave Confidence level on 95 %.
  4. The Difference-in-differences card shows 0.71, with the counterfactual 2.56, standard error 0.162, t 4.39 on 232 degrees of freedom, p well under 0.001 and the interval 0.39 to 1.03.
  5. Now clear the four SD boxes. The estimate stays 0.71 and the interval disappears: with means only, there is an effect size but no uncertainty.
  6. For the last row of our table, open the effect size converter, choose Start from Two means and standard deviations and type the post-test cells (3.27, SD 0.58, size 59; 2.58, SD 0.66, size 59). It reports Cohen’s d 1.11 with a 95 % interval of about 0.72 to 1.50.

What researchers can use it for

  • Re-read any pretest-posttest control-group paper as a DiD. If the four cells are printed, the estimate and its interval take under a minute, and they do not depend on the authors’ model.
  • Sanity-check reported effect sizes. A d for the change scores, a d for the post-test and a partial eta squared from an ANCOVA are three different numbers; the effect size converter shows what each one implies.
  • Spot impossible change scores. If a paper gives means, SDs and a dz, the implied before-after correlation follows. A negative one means something has gone wrong in the reporting, as it has here.
  • Plan the next study. Once you know the honest standard error, sample size gives the class count needed to detect a smaller effect.
  • Move to panel data. With several years or several schools, the same tool fits two-way fixed effects with clustered errors and an event study, so pre-trends can be tested rather than assumed.

The fine print

  • Our estimate uses only the four printed cells. We do not have pupil-level data, so we cannot test parallel trends: with one period before the lessons, DiD assumes the two classes would have drifted alike, and that assumption cannot be checked here.
  • The classes were intact, not randomly assigned. The pretest means are very close (2.39 against 2.41), which helps, but unmeasured class differences remain.
  • The implied before-after correlations are derived from the paper’s own dz values. If the dz values are typos, the correlations are too, and the paper’s real precision is better than its gain-score test suggests.
  • The 1 to 4 scale is an average of rated items, so points are not equal-interval units; the standardised effect sizes are easier to compare across studies.

Sources

  • Kurebay, B., Mailybayeva, G., Sharipkhojayeva, Z., Zharkumbayeva, M. and Kozhamkulova, N. (2026), Digital technology integration for developing research competence in primary school students, Frontiers in Education 11: 1821816, doi:10.3389/feduc.2026.1821816. Licence CC BY 4.0 (Creative Commons Attribution), checked on the Frontiers article page and in the publisher's Crossref record, 2026-11-24. Values used here: 118 pupils in grades 3 and 4, 59 per group, nine weeks; research-competence score on a 1 to 4 scale; digital-inquiry class 2.39 (SD 0.61) before and 3.27 (SD 0.58) after; ordinary class 2.41 (SD 0.63) before and 2.58 (SD 0.66) after; within-group paired t(58) = 7.18 with dz = 0.94 and t(58) = 1.24 with dz = 0.16; gain-score comparison t(116) = 3.86, d = 0.71; ANCOVA F(1, 115) = 38.64, partial eta squared 0.25; advanced rubric products 26 of 59 against 7 of 59.
  • The 2 x 2 difference-in-differences estimator and its standard error from four independent cells: Angrist, J. D. and Pischke, J.-S. (2009), Mostly Harmless Econometrics, Princeton University Press, chapter 5.

If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.

Tools in this article

Read next