Statistics Lab · step 07

Complete the analysis.

Bring the dataset, decisions, syntax, model checks and reporting into one reproducible medical-statistics workflow.

Outcome: a complete worked analysis that can be rerun from the common CSV in any of the three software routes.

Seven-step investigationNow: 07 · Complete the analysis

Analysis checkpoint

Make the whole analysis reproducible and reportable.

Work through these six prompts in order. Each one supplies what the next one needs.

1 · Before you start

Steps 01–06 should run without unexplained errors, and each reported estimate should have a named question, outcome, reference group and effect scale.

Words used on this page

Reproducible analysis
an analysis another person can rerun from the source data and syntax.
Audit trail
the saved record connecting data checks, decisions, commands, output and reported numbers.
Residual confounding
confounding that remains because variables were unmeasured or imperfectly measured.
2 · Why this comes now

The final step checks the golden thread from cohort design to interpretation. A correct isolated model is not enough if the data checks, denominators, wording or saved evidence do not agree.

3 · Do this now
  1. Restart from the common CSV and run the numbered syntax from beginning to end.
  2. Check that every table, estimate, interval and analysis n matches the reported interpretation.
  3. Save syntax, output, software version and the labelled analysis copy together.
Same step in Stata and SPSS

Run the complete Stata do-file or complete SPSS syntax file from a clean start. The final conclusions should agree across routes even though the output layout differs.

4 · Read this

Read the log or Output Viewer for errors first, then trace each reported number back to its table or model. Check that observational associations have not become causal claims.

5 · Ready to continue when

Another student could rerun the work, find every reported number, explain each decision and reach the same appropriately cautious conclusion.

6 · Next step Use the analysis in the thesis workflow Carry the design, methods, findings, uncertainty and limitations into the written argument.

End-to-end

Run the analysis in a fixed order.

  1. Define the study: population, exposure, outcomes, time zero and follow-up.
  2. Audit the file: identifiers, ranges, codes, missingness and one-row meaning.
  3. Characterise: distributions and missing values before inferential tests.
  4. Compare: show denominators, effect estimates and confidence intervals.
  5. Model: choose the family from the outcome and check assumptions.
  6. Address confounding: justify pre-exposure covariates from subject knowledge.
  7. Report and preserve: save syntax, output, versions and a labelled analysis copy.

Complete package

Everything needed to reproduce the worked example.

Worked reporting

Say what was estimated.

In the synthetic cohort, 45 of 200 participants who received a medication review and 112 of 512 who did not receive one had activity-limiting disability at six months. The crude risk ratio was 1.03 (95% CI 0.76 to 1.40). After adjustment for age, baseline frailty, sex, living alone, deprivation, medication count and baseline disability, the disability odds ratio was 0.64 (95% CI 0.41 to 1.01).

The adjusted six-month EQ-5D-style mean difference was +0.047 (95% CI 0.034 to 0.059). Because review allocation was observational and the data are simulated, these estimates illustrate confounding and model interpretation; they are not clinical-effect estimates.

Representative output · same teaching data in all three routes

Primary worked findings

Crude disability risk ratio             1.03 (95% CI 0.76 to 1.40)
Adjusted disability odds ratio          0.64 (95% CI 0.41 to 1.01)
Adjusted quality-of-life difference    +0.047 (95% CI 0.034 to 0.059)
Adjusted frailty common odds ratio      0.43 (95% CI 0.28 to 0.66)
Adjusted falls incidence-rate ratio     0.79 (95% CI 0.63 to 0.98)
Adjusted admission hazard ratio         0.70 (95% CI 0.47 to 1.07)

What the output means

These estimates answer different questions and cannot be compared as if they were on one scale. Risk ratios compare probabilities, odds ratios compare odds, the mean difference remains in quality-of-life points, the incidence-rate ratio compares fall rates and the hazard ratio compares instantaneous admission hazards. All adjusted estimates remain observational cohort associations.

Write the interpretation like this

Medication review was associated with higher adjusted mean quality of life, lower odds of worse frailty and a lower fall rate at six months. Estimates for disability odds and admission hazard were imprecise and compatible with no association. Because review was not randomised, the findings should not be interpreted as causal effects.

Include the event definition, time horizon, reference group, covariates, effect scale and confidence interval. “Significant” or “not significant” is not a results paragraph.

Before submission

A compact reproducibility check.

Files

One source of truth

Raw teaching CSV unchanged; labelled analysis copy generated by syntax.

Software

Version recorded

Record Stata, SPSS or R and relevant package versions.

Decisions

Models justified

Outcome type, reference groups, missing-data handling and covariates are explicit.

Claims

Design respected

Observational results remain associations unless a defensible causal analysis supports more.