CHAPTER 36: Rates, effect size and interval interpretation

36a: Two points and twenty percent describe one change
36b: Follow the uncertainty around the observed difference

HOW TO RUN
Open a terminal in the extracted companion folder, the folder containing
automation, sql and visual_labs. Run:

    python visual_labs/ch36/walkthrough.py

Use python3 or py instead of python if that is the command established in
Chapter 15. No extra Python package is needed. Run it only after predicting
the displayed states. The exact output is also in expected_output.txt.

When a lab imports the automation examples, its short Path/sys.path setup
locates those existing modules relative to this file. It changes where this
Python process looks for imports; it does not change your operating-system
configuration. Preserve the extracted folder structure.

SOURCE AND MEANING
These are the chapter's synthetic experiment counts. The uncertainty results
use automation/chapter36_experiment.py's existing interval function. The lab
does not assign real visitors or start a live experiment.

FOLLOW BEFORE YOU RUN
Divide each conversion count by its visitor count yourself. For the 100-visitor
example, write the fractional rates 0.10 and 0.12 before formatting percentages.
Then write the absolute difference and the change relative to A separately.

PREDICT, RUN, COMPARE
First change only B's visitors from 100 to 200. Next consider the separate
1,000-per-group experiment: what happens to its interval when B conversions
increase from 120 to 150? Both changes are performed visibly by the script.
Compare the sign of each endpoint with zero; do not select a winner from the
observed difference alone.

ONE MORE INPUT TO REASON THROUGH
Suppose both larger groups convert exactly 100 of 1,000 visitors. Does an
observed difference of zero prove identical underlying effects?

EXPLAINED ANSWER
No. The observed difference is zero, but this method produces an interval of
about -2.63 to +2.63 percentage points. In a temporary practice file in this
same ch36 folder, copy the initial import/path lines and print
interval(100, 1000, 100, 1000); multiply the three returned fractions by 100
to express percentage points. Equivalence requires its own planned question.
The formula still assumes the independent groups and valid design described
in Chapter 36; a numerical interval cannot repair broken assignment.

EXPECTED OUTPUT (verified by execution)

36a: Two descriptions of the observed change
Points: 2.0
Relative change: 20.0%
Change only B's visitor count from 100 to 200:
B rate: 6.0%
Points: -4.0
Relative change: -40.0%
36b: Follow the larger experiment
A contribution: 0.0000900
B contribution: 0.0001056
Standard error: 0.01399
Half-width: 0.02741
B conversions 120: difference 2.00 points; interval -0.74 to 4.74
Spans zero: True
B conversions 150: difference 5.00 points; interval 2.11 to 7.89
Spans zero: False

All data in this lab are fictional teaching examples.
