One patient-shaped table
Rows are participants; columns are variables. A blank follow-up value is missing, not “no event”.
Software first contact
New to Stata? Find the data, saved instructions and output, then run one checked block with the shared cohort.
Use this optional on-ramp when the statistics desk is new. You will open the common cohort, run one saved block and be ready for Jennifer’s Analysis Step 01.
Your short software on-ramp
This is not a separate statistics course. It teaches only the Stata moves needed to open the shared cohort, run a saved instruction and recognise a correct result.
Before you start: no software knowledge is required. This page prepares the statistics desk; it does not teach the whole analysis. You need access to Stata and permission to save the teaching files in one folder. Read Jennifer’s fictional study background before beginning Step 01.
By the end you can
1 · Purpose
Stata is widely used for epidemiology, public health, clinical and health-services research. It combines data management, statistical models, survival analysis, graphics and epidemiological tables in one consistent command language.
The safe mental model is data + do-file → Results. Menus and the Command window can help you explore, but the saved do-file is the analysis record another researcher can inspect and rerun.
Rows are participants; columns are variables. A blank follow-up value is missing, not “no event”.
Commands run in order, with comments explaining each analytical decision.
Tables, estimates, intervals, warnings and graphs appear in Results; the do-file remains the reproducible source.
2 · Open or access it
Stata is licensed software. First check your university or employer software portal: you may be offered a managed desktop install, remote desktop or institutional licence. Use the version and edition your organisation supports.
.do file in one folder. Choose File → Change Working Directory and select it.A licence or activation error is an access problem, not a statistics problem. Use your institution’s supported route or Stata’s official installation guide in Go deeper.
3 · Find the statistics desk
Write, comment and save the reproducible sequence. Highlight a block and run it; do not rebuild the analysis from memory.
Commands echo here with tables, estimates, notes and red error messages. Read the first error before changing code.
Shows names, labels and types currently in memory. It helps with spelling but does not replace the codebook.
Command is useful for a quick check; History records what ran. Move any important command into the do-file.
4 · First reproducible run
Open the supplied do-file, or paste the block below into a new one. Run the complete block from the Do-file Editor. It checks the unique participant identifier, then asks: “How many people received medication review?” and “What is the cohort’s mean and age range?”
clear all
import delimited using "gerostats_medication_review_cohort.csv", ///
varnames(1) clear
isid participant_id
count
tabulate med_review, missing
summarize age_years
The same software-neutral, entirely synthetic data used in all three routes.
Download the CSVUse its opening block now; later sections match the guided medical-statistics journey.
Download the .do file5 · Successful output
Expected result
isid participant_id finishes without an error.
Values 0 and 1 are codes, not yet
reader-friendly labels. Step 01 keeps the raw field auditable and adds
labels for interpretation. These summaries describe the cohort; they
do not test whether review improved an outcome.
6 · First-run problems
r(601) file not foundStata’s working directory does not contain the CSV. Run pwd, change folder, and keep the quoted filename exact.
no; data in memory would be lostThe current data have unsaved changes. For this synthetic exercise, rerun the supplied block from clear all; never do this with unsaved real work.
variable ... not foundCheck that import succeeded and inspect describe. Stata names are case-sensitive and must match the CSV header.
Stop. Re-download the common CSV and rerun the import from a clean session before calculating any statistic.
r(...) number attached to an error; use it to identify the cause.Optional references for software detail, epidemiological methods and reproducible health-research reporting. You do not need these to begin Step 01.
Desktop download, edition selection and licence activation. Use institutional instructions first when access is managed.
Open Stata installation guidanceShort official demonstrations of the interface, data management, tables and regression workflow.
Open Stata videosMethods, formulas and examples for risks, odds, rate ratios and stratified epidemiological tables.
Open the epitab manual (PDF)Clinical examples covering displays, uncertainty, tests and study design; the free online text is an older edition.
Open the BMJ referenceOn-ramp complete
You can open the shared data, run saved instructions and recognise a correct first result. Continue to Jennifer’s Analysis Step 01, where you will check the study design, timeline, variables and whether the file matches the fictional study.