Are the mean lengths of male and female Coyotes the same?

This example describes a randomisation test.

Simulation
New data sets are generated directly from the model.
Randomisation
Modifications to the actual data are generated that would have been as likely as the original data.

The actual data are shown on the left. Randomisation uses the same values but randomly allocates them to the two groups. Click Randomise to randomly pick 40 of the the 83 lengths for the female group.

The difference between the mean lengths of males and females is the test statistic — it will be far from zero if H0 (no difference between the males and females) is false.

Click Accumulate and repeat the randomisation several more times. (Uncheck Animate to speed up the randomisation.)

A difference in means as far from zero as 2.8 cm occurs in about 6% of randomisations, so it is not particularly unlikely. There is therefore little evidence of a difference between males and females .

Emphasise the general concepts:

Null hypothesis, H0
Each body length would have been equally likely in a male or female coyote
Alternative hypothesis, HA
Male coyotes tend to be bigger than females
Test statistic
Difference between mean body lengths of male and female coyotes
P-value
Probability of getting a difference that is so large if H0 is true
Conclusion
A small p-value gives evidence that H0 is not true.

In a study of coyotes, 40 female and 43 males were captured in Nova Scotia. The data set contains the lengths (cm) of these coyotes.