control-tool-example 120 6000 -> 2 control-one-percent 1 100 -> 1 decimal-ctr 450 10000 -> 4.5 repeating 1 3 -> 33.3333 zero-clicks 0 5000 -> 0 all-clicked 100 100 -> 100 more-clicks-than-impressions 120 100 -> 120 pooled-totals 1876 58200 -> 3.2234 large 250000 5000000 -> 5 edge-zero-impressions 5 0 -> no number edge-negative-clicks -5 1000 -> no number edge-empty-impressions 5 -> no number control-tool-example expected=2 tool=2 script=2 TOOL-OK SCRIPT-OK | tool text: 2 % control-one-percent expected=1 tool=1 script=1 TOOL-OK SCRIPT-OK | tool text: 1 % decimal-ctr expected=4.5 tool=4.5 script=4.5 TOOL-OK SCRIPT-OK | tool text: 4.5 % repeating expected=33.3333 tool=33.3333 script=33.3333 TOOL-OK SCRIPT-OK | tool text: 33.3333 % zero-clicks expected=0 tool=0 script=0 TOOL-OK SCRIPT-OK | tool text: 0 % all-clicked expected=100 tool=100 script=100 TOOL-OK SCRIPT-OK | tool text: 100 % more-clicks-than-impressions expected=120 tool=120 script=120 TOOL-OK SCRIPT-OK | tool text: 120 % pooled-totals expected=3.2234 tool=3.2234 script=3.2234 TOOL-OK SCRIPT-OK | tool text: 3.2234 % large expected=5 tool=5 script=5 TOOL-OK SCRIPT-OK | tool text: 5 % edge-zero-impressions expected=no number tool=no number script=no number TOOL-OK SCRIPT-OK | tool text: CTR is undefined with zero impressions. edge-negative-clicks expected=no number tool=no number script=no number TOOL-OK SCRIPT-OK | tool text: Recorded clicks: enter a whole number from 0 to 1000000000000000. edge-empty-impressions expected=no number tool=no number script=no number TOOL-OK SCRIPT-OK | tool text: Delivered impressions: enter a whole number from 0 to 1000000000000000. tool agrees on 12 of 12, script on 12 of 12 == 1. pooled CTR against the plain average of row CTRs (videos.csv, constructed) Short A: CTR = 8.0000% Long B: CTR = 3.0000% Talk C: CTR = 4.5000% Pooled CTR (all clicks / all impressions) = 3.2234% Plain average of the row CTRs = 5.1667% == 2. the views-over-impressions trap (constructed: 10,000 counted impressions, 450 views from them, 300 other views) CTR from counted impressions = 4.500 % total views / impressions = 7.500 % == 3. same CTR, different amount of data (constructed 4.5%) 9 clicks in 200 impressions: CTR = 4.5000%, 95% Wilson interval 2.3853% to 8.3297% 900 clicks in 20,000 impressions: CTR = 4.5000%, 95% Wilson interval 4.2213% to 4.7961% == 4. control for the interval: 50 of 100 is 50% and the hand calculation gives about 40.38% to 59.62% CTR = 50.0000%, 95% Wilson interval 40.3832% to 59.6168% == 5. two constructed thumbnails, same share, 200 impressions each A 8 clicks: CTR = 4.0000%, 95% Wilson interval 2.0406% to 7.6932% B 10 clicks: CTR = 5.0000%, 95% Wilson interval 2.7383% to 8.9578%