Bootstrap a difference in means

Mediumbootstrapchoicepercentile· 20 XP

A small test compared minutes spent on a page for the old design and a new one (illustrative numbers). Before claiming the new design wins, the team wants a 95% range for the gap in averages.

With a generator seeded with 3, draw 3,000 bootstrap samples of new and then 3,000 of old (each sample the same size as its group, with replacement). For each pair, work out new mean minus old mean, and store the 2.5th and 97.5th percentiles of those gaps, rounded to 2 decimals.

Expected answer

Store your answer in result.

Hints, the later steps and the answer come with Pro.

import numpy as np

rng = np.random.default_rng(3)
new = np.array([5.2, 6.8, 4.9, 7.5, 6.1, 5.8, 8.0, 6.6, 5.5, 7.1])
old = np.array([4.8, 5.1, 6.0, 4.4, 5.6, 5.0, 4.9, 6.2, 5.3])
result = ...