WORKED EXAMPLE · REPLICATING A PAPER IN EXCEL

A paper’s supplementary data summarised and checked against its table

A graduate student replicating a 2025 PLOS ONE paper on PM2.5 pollution in 337 Chinese cities uploaded the paper and its supplementary Excel file. They asked for a summary sheet of the model coefficients in that workbook, checked against the means printed in the paper’s Table 6, with a chart.

wrote the summary as live formulas, read Table 6 from the PDF and matched all six means. Asked to add the second supplementary file, it copied the sheet in, extended the summary to twelve factors and redrew the chart as a sorted bar chart in two colours. The six new Table 6 means took one follow-up.

  • 12 / 12factor rows that match our own recalculation
  • ≤ 0.0005difference from Table 6, every factor
  • 3requests, the last one a follow-up
  • 0.52credits in all

Open the real files

The paper and its supplementary files are linked at PLOS ONE. The three workbooks are the ones from the run. Download them and open them in Excel.

Where the files come from: PLOS ONE, “Identifying the spatiotemporal patterns and natural and socioeconomic influencing factors of PM2.5 and O3 pollution in China” (2025), with its S1 and S2 supplementary files. Published under CC BY 4.0. The authors have not reviewed or endorsed this example.

01 · THE STARTING FILE

337 cities, 24 columns of coefficients, and a table in a PDF

The S1 file has one sheet: one row per city, and for each of six socioeconomic factors its local coefficient (beta_), standard error, t value and p value. The S2 file has the same layout for six natural factors. The paper reports the mean of each coefficient in Table 6, on page 13 of the PDF.

S1_File_data_for_Fig5.xlsxbefore
A1City
ABCDEFGT
1Citybeta_Popdenbeta_PGDPbeta_Prosecbeta_Energybeta_Roaddenbeta_NDVIp_Popden
2Da Hinggan Ling Mountains0.569-0.0960.0800.025-0.087-0.0670.000
3Heihe0.570-0.0990.1080.025-0.091-0.0690.000
4Yichun0.569-0.1020.1170.025-0.093-0.0720.000
5Hulunbuir0.566-0.1050.0880.025-0.089-0.0630.000
6Qiqihar0.567-0.1060.1110.024-0.092-0.0660.000
…
338Shihezi0.404-0.207-0.0730.037-0.080-0.1300.000
PM2.5_socioeconomic
The first rows of the data sheet (columns A–G and the p value of Popden in T; the other columns are hidden here).

02 · REQUEST 1

"Add a Summary sheet, checked against Table 6"

What the student typed

I'm replicating the PM2.5 paper attached (PLOS ONE 2025). S1_File_data_for_Fig5.xlsx has the local MGWR results for 337 cities on sheet 'PM2.5_socioeconomic' (beta_, se_, t_ and p_ columns for Popden, PGDP, Prosec, Energy, Roadden, NDVI).

In this workbook, add a sheet 'Summary' with one row per factor and these columns:
1. Mean, SD (sample), Min, Median, Max of the beta_ coefficient
2. Number of cities with p < 0.05 (use the p_ column), split into positive and negative beta
3. The mean reported in the paper's Table 6 (PDF page 13), and the difference from our mean

Use formulas pointing at the data sheet where you can. Then add a native Excel bar chart of the six mean coefficients on the Summary sheet. Leave the data sheet unchanged.

What did

  • Added a “Summary” sheet with one row per factor: mean, sample SD, min, median and max of each beta_ column as formulas over all 337 rows.
  • Counted the cities with p < 0.05, split by the sign of beta, with COUNTIFS on the p_ and beta_ columns.
  • Read Table 6 from page 13 of the PDF, typed in its six means and added a difference column as a formula.
  • Added a native Excel bar chart of the six means and left the data sheet unchanged.
S1_File_data_for_Fig5.xlsxsame file
A1Factor
ABCDEFGHIJ
1FactorMean (beta)SD sample (beta)Min (beta)Median (beta)Max (beta)Significant p<0.05, beta>0 (n)Significant p<0.05, beta<0 (n)Paper Table 6 meanDifference (our mean minus paper)
2Popden0.43960.2030-0.00880.38871.089726300.4400-0.0004
3PGDP-0.04060.1479-0.4360-0.05650.30662648-0.04100.0004
4Prosec0.08420.0493-0.08230.10320.1208166160.08400.0002
5Energy0.02070.00510.01410.01960.0439000.0210-0.0003
6Roadden-0.10180.0057-0.1092-0.1029-0.074500-0.10200.0002
7NDVI-0.03110.0358-0.1439-0.02380.015708-0.0310-0.0001
PM2.5_socioeconomicSummarynew
The new “Summary” sheet as delivered. Green numbers are formulas; click one to see it.
S1_File_data_for_Fig5.xlsxSummary sheet

Mean MGWR coefficient (beta) by factor

-0.20.00.20.40.6Mean betaPopdenPGDPProsecEnergyRoaddenNDVIFactorMean (beta) · Popden: 0.440Mean (beta) · PGDP: -0.041Mean (beta) · Prosec: 0.084Mean (beta) · Energy: 0.021Mean (beta) · Roadden: -0.102Mean (beta) · NDVI: -0.031
The chart on the “Summary” sheet, redrawn here from the data inside the delivered file.

We checked it against the data: we recomputed every statistic from the 337 rows: all six rows match to three decimals, the counts included (Popden 263 positive, PGDP 26 and 48, Prosec 166 and 16, NDVI 8 negative), and every mean matches Table 6 to three decimals; the difference column shows only the rounding, at most 0.0004.

03 · REQUEST 2

"Now add the natural factors from the second file"

What the student typed

Now add the natural factors. In the same workbook:

1. Copy sheet 'PM2.5_natural' from S2_File_data_for_Fig6.xlsx (attached) in as a second data sheet, unchanged.
2. Extend the Summary to all 12 factors (Tem, Pre, Ws, Rh, Ap, Sd below the six socioeconomic ones), same columns, including the Table 6 means.
3. Change the chart to a horizontal bar chart of all 12 means, sorted from largest to smallest, with socioeconomic and natural factors in two different colours and a legend saying which is which.

Don't change the existing six Summary rows.

What did

  • Copied the “PM2.5_natural” sheet from the S2 file into the workbook with all 337 rows.
  • Added six rows for Tem, Pre, Ws, Rh, Ap and Sd with the same formulas, and left the first six rows unchanged.
  • Built a helper table in L1:N13: the twelve means sorted from largest to smallest, one column per group.
  • Replaced the chart with a horizontal bar chart of that table: twelve bars, socioeconomic and natural factors in two colours, with a legend.
  • Left the Table 6 means of the new factors empty: the paper was not among the files it read for this request. Its finish message said so and offered to fill them in if the paper was attached.
S1_File_data_for_Fig5.xlsxsame file
A1Factor
ABCDEFGHIJ
1FactorMean (beta)SD sample (beta)Min (beta)Median (beta)Max (beta)Significant p<0.05, beta>0 (n)Significant p<0.05, beta<0 (n)Paper Table 6 meanDifference (our mean minus paper)
2Popden0.43960.2030-0.00880.38871.089726300.4400-0.0004
3PGDP-0.04060.1479-0.4360-0.05650.30662648-0.04100.0004
4Prosec0.08420.0493-0.08230.10320.1208166160.08400.0002
5Energy0.02070.00510.01410.01960.0439000.0210-0.0003
6Roadden-0.10180.0057-0.1092-0.1029-0.074500-0.10200.0002
7NDVI-0.03110.0358-0.1439-0.02380.015708-0.0310-0.0001
8Tem-0.52830.3172-0.9254-0.55540.08280282
9Pre-0.29080.2039-0.8050-0.24260.05680164
10Ws0.04240.2451-0.75040.05600.58927724
11Rh0.03650.1642-0.25360.00000.3140525
12Ap0.63540.00890.61440.63540.64863370
13Sd-0.21270.0132-0.2385-0.2124-0.17570337
PM2.5_socioeconomicSummaryPM2.5_naturalnew
The Summary sheet after request 2: the six natural factors (yellow), with columns I and J still empty for them.
S1_File_data_for_Fig5.xlsxSummary sheet

Mean MGWR coefficient (beta) by factor

  • Socioeconomic
  • Natural
The new chart, redrawn here from the data inside the delivered file.
S1_File_data_for_Fig5.xlsxhelper table
L1Factor
LMN
1FactorSocioeconomicNatural
2Ap00.635383529
3Popden0.43959286640
4Prosec0.084240647310
5Ws00.04236848852
6Rh00.0364906784
7Energy0.020651232830
8NDVI-0.031148981010
9PGDP-0.040595839970
10Roadden-0.10181387450
11Sd0-0.2126999148
12Pre0-0.2908334881
13Tem0-0.5282885883
Summary
Columns L to N of the same sheet: the twelve means, sorted, split into the two series the chart reads.

We checked it against the data: the six new rows match our recalculation from the S2 data, the copied sheet holds the same numbers as the S2 file, the first six rows are unchanged, and the chart has two series of twelve values in the sorted order.

04 · FOLLOW-UP

"The Table 6 means are still missing"

What the student typed, with the paper attached again

The Table 6 means for Tem, Pre, Ws, Rh, Ap and Sd are still missing in the Summary. They are in Table 6 on page 13 of the paper attached. Please fill them in, with the difference from our mean, like the six socioeconomic rows.

What did

  • Read the six natural-factor means from Table 6 on page 13 and typed them in.
  • Wrote their differences with the same formula as the first six rows.
S1_File_data_for_Fig5.xlsxafter
A1Factor
ABCDEFGHIJ
1FactorMean (beta)SD sample (beta)Min (beta)Median (beta)Max (beta)Significant p<0.05, beta>0 (n)Significant p<0.05, beta<0 (n)Paper Table 6 meanDifference (our mean minus paper)
2Popden0.43960.2030-0.00880.38871.089726300.4400-0.0004
3PGDP-0.04060.1479-0.4360-0.05650.30662648-0.04100.0004
4Prosec0.08420.0493-0.08230.10320.1208166160.08400.0002
5Energy0.02070.00510.01410.01960.0439000.0210-0.0003
6Roadden-0.10180.0057-0.1092-0.1029-0.074500-0.10200.0002
7NDVI-0.03110.0358-0.1439-0.02380.015708-0.0310-0.0001
8Tem-0.52830.3172-0.9254-0.55540.08280282-0.5280-0.0003
9Pre-0.29080.2039-0.8050-0.24260.05680164-0.29100.0002
10Ws0.04240.2451-0.75040.05600.589277240.04200.0004
11Rh0.03650.1642-0.25360.00000.31405250.03600.0005
12Ap0.63540.00890.61440.63540.648633700.63500.0004
13Sd-0.21270.0132-0.2385-0.2124-0.17570337-0.21300.0003
PM2.5_socioeconomicSummaryPM2.5_natural
The Summary sheet after the follow-up: all twelve rows complete, the natural factors in yellow.

We checked it against the data: all twelve rows match our recalculation from the two data sheets, and all twelve Table 6 means are right (Tem −0.528, Pre −0.291, Ws 0.042, Rh 0.036, Ap 0.635, Sd −0.213); the S1 data sheet is unchanged and the copied S2 sheet holds the same numbers.

Replication work, in the authors’ own files

reads the paper and the supplementary data together, writes the statistics as formulas you can audit, and puts the published figures beside them so any gap shows.

KEEP READING

Read another worked example

See all 19 worked examples All examples for Academics