Module 01 Activity
Scenario
You have been asked whether a change worked. Set the project up so the answer is checkable by somebody who does not trust you.
What you build
A statistical project with a dated analysis plan, importable analysis modules and a report that only cites.
Steps
- Write the analysis plan first: question, outcome, unit, comparison, primary test, alpha and sidedness. Date it.
- Create the folders, including one for the plan, and put the raw data where no code writes.
- Put
rng = np.random.default_rng(seed)once at the top and pass the generator down. Record the seed in the report. - Build the analysis table explicitly: the planned columns only, the grain set, grouping variables as
Categoricalwith deliberate category order. - Encode every exclusion as a named constant with its reason, and print how many rows it removed from each group.
- Tidy every planned test into one DataFrame with the estimate, interval and p-value, then write the interpretation separately.
Evidence to hand in
- The dated analysis plan.
- The folder listing.
- The analysis table, with what was dropped from raw.
- The exclusion rules and their per-group row counts.
- The results DataFrame covering every planned comparison.
- The interpretation cell.
Review checklist
- The plan predates the analysis and names the primary test and alpha.
- A single
default_rngseeds the work and its value is in the report. - Every column in the analysis table was named in the plan.
- Every exclusion is a named constant with a printed row count.
- The results table contains all planned comparisons, not only the significant ones.
