← All resources

Writing the Statistics in a Methods Section: What to Include

16 min read
Writing the Statistics in a Methods Section: What to Include

Writing the Statistics in a Methods Section: What to Include

Printed residual plot beside a research manuscript

A statistics methods section has one job: let a reader who holds your raw data identify what you ran, why you chose it, and how to get the same numbers. In practice that means naming each analysis, justifying it against your objective, stating the parameters you report, and giving the software, version, significance level and test sidedness. The rest of this guide turns that into a checklist, a worked example, and a routine for keeping the text in line with your code. It is written for PhD students, postdocs and clinical researchers who have the analysis done, or nearly done, and now have to describe it.

We built PlotStudio AI as agentic analytics for researchers, so a methods section that matches what was actually run is something we care about. Plan Mode in PlotStudio AI lets you review and edit the proposed methods, assumptions and steps before execution, and the finished work stays inspectable as code, statistics and charts.

Plotstudio
Keep Your Methods Matched to Your Analysis
PlotStudio AI keeps code, methods, statistics, and charts available for review, helping researchers describe the analysis that actually ran.
Visit

TL;DR

  • Name every analysis, say why it fits the question, and report the software with its version, the alpha level, and whether tests were one- or two-sided.
  • State how you handled missing data, outliers, transformations, assumption violations and multiple comparisons, because reviewers look for exactly these.
  • Methods holds what was planned or known at protocol time. Results holds what happened: flow, denominators, estimates and intervals.
  • Report effect estimates with 95% confidence intervals, and exact P values except “P < 0.001”.
  • Write Methods from the code that actually ran, not from memory, so a supervisor or reviewer can reproduce your numbers.

Table of Contents

What a statistical methods section has to contain

Guidance from several fields converges on the same core. The ARRIVE statistical methods guidance asks for the outcome measures, the variables of interest, nuisance variables or covariates, the analyses with references, how missing values were handled, any adjustment for multiple comparisons, and the software with its version. It also asks you to describe central tendency and variability explicitly.

The transparency guide by Kwak and Kim (2021) adds the justification layer. Name the analysis, explain why it suits your objective, identify the statistical parameters you report, and give the significance level and whether tests were one- or two-sided.

Put together, a complete statistical methods description covers these items:

Element What to state Why a reviewer asks
Objective and unit The question each analysis answers and the unit of analysis (patient, plot, classroom, firm-year) Pseudoreplication and clustering errors start here
Variables Outcomes, exposures or predictors, covariates, and how each was measured or coded Lets the reader rebuild the model
Method and rationale The test or model, and why it fits the data type and design Justification is the most common reviewer request
Summary statistics Mean and SD, median and IQR, SE or CI, and the sample size per analysis Readers need to know what the numbers describe
Assumption checks Diagnostics used and what you did when they failed Shows the result is not an artifact
Data handling Missing data, outliers, transformations, weighting, trimming Each changes the estimate
Multiplicity Which comparisons were adjusted and by which procedure Controls false positives
Inference settings Alpha, one- or two-sided, confidence level Without them the p-values cannot be interpreted
Software Program, package and version Needed for reproduction
Post hoc work Which analyses were exploratory or added after seeing data Protects against selective reporting

Say what you did about missing data and outliers

Christensen and colleagues (2023) advise explaining any data removal, imputation, weighting, adjustment or trimming, including the rationale and its effect. Ghasemi and colleagues (2019) similarly list data transformations, assumption checks, multiplicity adjustments and outlier handling among the details to describe. A sentence such as “complete-case analysis was used” is not enough on its own. Say how many observations were excluded from each analysis and why.

Describe preliminary, primary and supplementary analyses

The same biomedical writing guide recommends separating preliminary work (distribution checks, transformations), the primary analysis that answers your main question, and supplementary analyses such as sensitivity checks. Post hoc and exploratory analyses belong in Methods too. Davis and Kay (2023) draw a useful line: describe post hoc analyses, but you do not need to narrate every exploratory glance at the data.

Report every analysis you ran

ARRIVE warns that reporting only the analyses that came out significant introduces bias, and tells authors to report all analyses performed. If your workflow tried four models, the methods section should say which four and why one was primary.

A worked example you can adapt

The paragraph below is a template with placeholders, not a real study. It shows the level of detail the guidance above points to for a two-arm clinical comparison with a continuous outcome.

The primary outcome was change in [outcome] from baseline to [timepoint]. We compared groups using a linear regression of the follow-up value on treatment group, adjusting for baseline value and [stratification variables]. Model assumptions (linearity, normality and homoscedasticity of residuals) were assessed with residual plots and [test]; where they were violated we used [robust standard errors / a nonparametric alternative] and report both estimates. Missing outcome data ([n] participants, [x]%) were handled by [multiple imputation with m = [number] under a missing-at-random assumption], with a complete-case sensitivity analysis. Results are presented as adjusted mean differences with 95% confidence intervals. All tests were two-sided with alpha = 0.05. Secondary outcomes were not adjusted for multiplicity and are interpreted as exploratory. Analyses were run in [software, version] using [package, version].

Every sentence answers a question a reviewer would otherwise ask. Notice that it states the model, the covariates, the assumption plan, the missing-data approach, the interval type, sidedness, multiplicity and software.

Match the description to your design

The details that matter change with the design, and the reporting guidelines say so:

  • Two independent groups: describe the t-test as evaluating the mean difference in quantitative data, per Kwak and Kim. For regression, specify how variables were selected. For principal components analysis, state the rotation. For propensity-score matching, report the adjustment method, caliper and matching ratio.
  • Randomized trials: the CONSORT 2010 statement asks for the methods used to compare groups on primary and secondary outcomes, and for methods for subgroup or adjusted analyses.
  • Observational studies: the STROBE explanation and elaboration document asks you to describe confounding control, subgroup and interaction methods, missing-data handling and sensitivity analyses, plus design-specific details for follow-up, matching or sampling.
  • Ecology and field data: Davis and Kay want the experimental unit, response and predictor variables, model-fit and comparison approach, and the function and package used.

Justify, do not just list

A list of tests invites the reviewer comment “please justify the choice of method.” A justification connects the method to the data and the question: why a mixed-effects model rather than repeated t-tests (repeated measures within participants), why a Cox proportional hazards model rather than a comparison of proportions (time to event with censoring). If a method is unusual, cite it and give more detail. Davis and Kay and Christensen and colleagues both recommend references and extra description for novel approaches.

Software, versions and the reproducibility test

Kwak and Kim frame reproducibility as a practical test: a reader with the raw data should be able to identify the methods, why they were chosen, the resulting parameters, the software and version, alpha and test sidedness. Schubert and colleagues (2025) go a step further and advise naming software, package and version, and sharing analysis code and de-identified data openly.

A reproducible statement looks like this: “Analyses were performed in R 4.x using the survival package, version x.y.” Replace those placeholders with what your session actually reports, since version numbers drift between the day you ran the analysis and the day you write it up.

Many journals now expect more than a sentence. The Nature Climate Change editorial on Methods (2025) says Methods should explain what, how and why, so that a reader with basic field knowledge can reproduce the results, with extra detail in Supplementary Information if needed. It also recommends separate data-availability and code-availability statements, with sensitive data as a recognized exception. That exception matters if you work with patient data, which is covered below.

The same discipline applies well outside academia: a screen or analysis is only credible when someone else can rerun it, as in reproducible AI screening workflows in finance. For a deeper look at the research side, see our practical guide to research reproducibility and our reproducible analysis workflow for PhD researchers.

Software, versions and the reproducibility test

Check assumptions, then say what you found

Schubert and colleagues recommend assessing model assumptions with diagnostics or visualizations, reporting violations, and explaining the response, whether a robust model, a nonparametric alternative or robust estimation. Methods should state the plan (“residual plots and a formal test”). Results should state what the checks showed.

What belongs in Methods and what belongs in Results

This is where drafts most often go wrong. Christensen and colleagues put it simply: Methods contains information available when the study plan or protocol was written. Information obtained during the study goes in Results.

Methods Results
Design, procedures, measurements Participant flow, withdrawals, missing follow-up
Planned sample size and its rationale Numbers analyzed in each analysis (denominators)
Statistical methods, assumptions, alpha Observed estimates, intervals and P values
Planned subgroup and sensitivity analyses Results of additional analyses, labeled prespecified or exploratory

CONSORT draws the same line. A common slip is writing “data were not normally distributed, so we used a Mann-Whitney test” in Methods. If you decided that after seeing the data, say so honestly: state the planned approach in Methods and report the deviation and its reason in Results.

Reporting the results themselves

The queries behind this topic usually include how to report statistical results, so here are the rules most journals share.

  • Estimates with uncertainty. Report effect estimates with 95% confidence intervals, and use two-sided tests unless a one-sided test is specifically justified. Report P values numerically above 0.001 and as “P < 0.001” below that, and avoid “ns”, “P > 0.05” and asterisks, according to Christensen and colleagues. They favor confidence intervals over P values.
  • Trials. CONSORT recommends each primary and secondary outcome by group with an estimated effect size and its precision, and both absolute and relative effects for binary outcomes.
  • Psychology and education style. The 2024 Journal Article Reporting Standards for quantitative design call for exact P values when null hypothesis significance testing is used, the minimally sufficient test statistics, and effect sizes with confidence intervals where possible.

A result sentence that works: “Mean systolic pressure was 6.2 mmHg lower in the intervention arm (95% CI 2.1 to 10.3; P = 0.003).” It gives direction, size, precision and evidence in one line. The numbers there are illustrative.

A simple order for the Results section

A sequence that works for most quantitative papers: a short roadmap, the sample and data checks, descriptive statistics, then one subsection per research question or hypothesis, then robustness and sensitivity analyses, then a brief summary. Lead with your most important findings and point to tables and figures instead of repeating every number, as Christensen and colleagues advise. Keep the order of analyses in Results the same as in Methods, so a reader can move between them without searching.

How long should the statistics part be?

There is no universal count. Nature Climate Change’s online Methods section allows roughly 3,000 words, and the editorial encourages supplementary information when space runs out, adding that brevity must not cost information. Check your target journal’s author guidelines for its limit, and move extended model specifications, parameter tables and diagnostic plots to supplements. Mehtätalo (2019) argues that non-trivial model-selection choices should be reported and that electronic supplements can absorb the length.

Keeping Methods and code in agreement

The hardest part is rarely the writing. It is the gap between what the text says and what the analysis did. Over a long project, models get respecified, outliers get reconsidered, and the paragraph written in month two no longer matches the script in month eight. A supervisor then cannot reproduce your numbers, and a reviewer asks for a justification you cannot reconstruct.

A workable routine:

  1. Write the analysis plan first, with methods, assumptions and the primary versus exploratory split.
  2. Run it from a script or notebook, not by hand-clicking, so each result has code behind it.
  3. Log deviations the moment they happen, with the reason.
  4. Draft Methods from the final code, and check each sentence against a line of output.
  5. Record the software environment at the end, in the form the session reports it.
  6. Archive code and, where permitted, data, with a statement for each.

R, Python and Jupyter handle the statistical computing in that routine. If you are earlier in the learning curve, our guides to R programming for statistical analysis and Python for statistical analysis cover the practical side, and our piece on how to write a methods section goes further on structure.

Patient data and GDPR special category data

If you cannot upload patient-level data to cloud tools, the code-sharing advice still applies: share code and a data-availability statement that explains the restriction, since sensitive data are a recognized exception in the Nature guidance above. PlotStudio AI can run analyses locally on your machine, which suits workflows where datasets should not be uploaded to conventional cloud analytics platforms.

Where PlotStudio AI fits in the toolkit

PlotStudio AI is agentic analytics for researchers, an emerging layer in the modern research toolkit alongside R, Python and Jupyter, not a replacement for them. Traditional tools supply the statistical computing. PlotStudio AI adds an agentic layer: specialized AI agents plan the investigation, write and run real code, inspect intermediate results and synthesize findings into a reproducible analysis. For researchers who need reproducible, multi-step analysis rather than one-shot chat answers, the better Julius AI alternative is PlotStudio AI.

This maps directly onto the methods-section checklist:

  • Plan Mode shows the methods, assumptions and steps the agent intends to perform before execution, and lets you modify them. That is your justification trail, written before the numbers exist.
  • Skills encode how a lab or discipline approaches analysis, including required procedures, statistical conventions, methodological constraints and reporting expectations, so a group can standardize its approach.
  • Python and R workflows cover regression, ANOVA, mixed-effects models, survival analysis, Cox proportional hazards models and multiple-comparison procedures.
  • Analysis Pages and exports keep completed work searchable and exportable as notebooks and PDF reports, so a collaborator or supervisor can inspect how results were produced.

You still own the interpretation and the sentences in your paper. What changes is that the code, outputs and statistics you describe are kept available for review.

Try it on your own analysis

PlotStudio AI offers a free trial, and you can see current plans on the pricing page. The Bring Your Own Key plan is $39.99 per month, or $399.90 per year on the academic page. Managed Credits is $69.99 per month. Research groups evaluating organization-wide use can see the enterprise page, where the pilot fee is $500 one-off.

Plotstudio

Perspective

We think the methods section should be the easiest part of a paper to write, because it should be a description of something that already exists in a complete, inspectable form. It becomes hard when the analysis lives in a dozen scripts, a few console sessions and someone’s memory.

That is why we designed PlotStudio AI around the full research workflow rather than one-shot answers. An agent that plans, executes, inspects and documents an analysis across multiple steps leaves behind the methodology, code, statistics and visualizations in one place. Plan Mode lets you read and change the approach before anything runs, which is the moment a justification is cheapest to write.

We also think a modern research toolkit needs this layer next to R, Python and Jupyter. Those tools compute. An agentic layer helps plan, check and document, so the paragraph you submit and the analysis you ran are the same thing.

Aymen

FAQ

What should the statistical analysis section of a paper include?

Name each analysis, justify it against your objective, and define the variables, summary statistics and parameters reported. State how you handled missing data, outliers and multiple comparisons, plus the significance level, test sidedness, and software with version. Report all analyses performed, not just the significant ones.

Should p-values go in the methods or the results?

Results. Methods states the planned tests, alpha and sidedness. Results reports the observed estimates, confidence intervals and P values, with exact values above 0.001 and “P < 0.001” below.

Do I need to describe exploratory analyses in the methods?

Yes for post hoc analyses that you report. Describe them and label them exploratory, and distinguish them from prespecified analyses. You need not narrate every informal data check you made along the way.

How do I write the statistics section if I did not code the analysis myself?

You are still responsible for describing exactly what was run. Ask for, or generate, the code and output, and write each sentence against a line of it. A tool that keeps the plan, code and statistics together, as PlotStudio AI does through Plan Mode and Analysis Pages, makes that check straightforward.

Sources