AI can generate code, suggest charts, or explain output, but validity depends on data quality, study design, assumptions, and validation. Treat generated analysis as a draft to be tested, and preserve the lineage from raw observations to reported results.
When this workflow is useful
- Cleaning and exploring experimental or observational data
- Building statistical or machine-learning analyses
- Turning one-off analysis into a reproducible record
A practical sequence
- 01
Record provenance and structure
Retain read-only raw data, a dictionary, collection conditions, units, coding, and exclusions. Define boundaries before processing personal or restricted data.
- 02
Specify the analysis question
Distinguish exploratory from confirmatory work and state variables, outcomes, comparisons, confounders, and intended methods. Preserve result-driven changes.
- 03
Make cleaning auditable
Perform conversions, missing-data handling, anomaly checks, and derived variables in code. Test generated transformations on small cases, boundary values, and known outputs.
- 04
Model, diagnose, and validate
Examine assumptions, fit, leakage, overfitting, and multiplicity. Run sensitivity or external validation and pin software, seeds, parameters, and logs.
Quality-control questions
- Can raw, cleaned, and analysis data be traced?
- Does the method fit design and assumptions?
- Was generated code tested, reviewed, and versioned?
- Are uncertainty and sensitivity results reported?