← Back to the toy box

Shuffle it

342 penguins, each with a beak — a bill, to the people who measure them. Is a longer bill also a deeper bill? First the cloud. Then the question: how far would chance get all on its own?

length front to back depth = height, top→bottom

One thing first, because everyone trips over it: by bill depth we mean the height of the bill — top to bottom, seen from the side. Not the width, and not the length.

the cloud — bill length and bill depth

the shuffled worlds — the null distribution of r

Nothing here yet. Shuffle a penguin world and see where r lands.

Shuffling cuts the tie: every penguin keeps its own bill length, but gets the bill depth of a complete stranger. That way you build worlds in which length and depth no longer have anything to do with each other — pure chance. The question is: does that chance ever get as far as the real r? Watch how the heap hangs around zero, and where that red line stands.

For anyone who speaks R:

cor(bill_length_mm, sample(bill_depth_mm))

One word away from the real calculation: sample(). It shuffles the depth column. Do it a thousand times and you have a thousand worlds in which nothing goes with anything.

From The Regressive Backbone · Chapter 3 — The Little Rectangle · shuffling a correlation, to see how far chance gets on its own
Data: Palmer Penguins (Gorman et al., 2014; Horst et al., 2020) · Palmer Station LTER · CC0 · 342 penguins.