See the notes for this section here .


1 Import and explore data

The data file contains session time for page A vs. B:

  • 21 observations for page A
  • 15 observations for page B
Page Time
Page A 0.21
Page B 2.53
Page A 0.35
Page B 0.71
Page A 0.67
Page B 0.85

Visualize distribution of session times for either page:


2 Define permutation function

Steps:

  • Combine all session times together
  • Repeatedly shuffle and resample the data points, without replacement, into groups of 21 and 15 (to replicate the sizes of the two groups)
  • Calculate the difference between means of the two groups
  • Repeat the process 1000 times to create a distribution of differences