Lesson 8

A

Locked — confirm your name above to begin.

Two questions to start with.

72% of people whose parents have a particular genetic disease also have that disease. If you find out a person's parents have that disease, do you predict that they do too?

72% of people whose parents like a certain song also like that song. If you find out a person's parents like that song, do you predict that they do too?

Neither question can be answered yet, and it is not because one is about genes and the other is about a song. It is because 72% on its own is not information about anybody. Find the number that is missing.

  • 200 people, a hundred in each column. On the left, everyone whose parents have it; on the right, everyone whose parents do not.
  • A filled square is a person who has it themselves.
  • Top knob: what share of the left column have it. Start it at 72%.
  • Bottom knob: what share of the right column have it — the number the questions never gave you.
  • The switch relabels the trait. It changes no number on this page.
  • A pair of rates only counts once you lock it in. Sliding past an answer is not choosing it.
  • The last line is what the correlation buys you about one person, which is a good deal less than the correlation itself.
told the parents have it, you would say:
told they do not, you would say:
so knowing the parents moves your answer by:
and as a correlation, which is what the rest of this lesson measures:
which makes a guess about any one person less wrong than guessing blind

Controls

72%
72%

Pairs you have locked in

none yet

To open Stage B

  • Hold the top knob at 72% and make knowing the parents worth nothing. not yet
  • Hold it at 72% and make knowing the parents worth as much as it can be. not yet
  • Answer the question below.
Stage B is open.
You are told only that 72% of people whose parents have it have it themselves. What would the other rate have to be for that 72% to tell you nothing at all?
%

R code

p1 <- 0.72   # parents have itp2 <- 0.72   # parents do notparent <- rep(c(1, 0), each = 100)child  <- rbinom(200, 1, ifelse(parent == 1, p1, p2))# what knowing the parent buys youp1 - p2# and the same thing as a correlationcor(parent, child)

B

Solve Stage A to unlock this section.

Galton wrote to 205 families in 1885 and asked for the heights of everybody in them. 934 grown children came back, with both their parents.

Every height here is measured as a departure from the average of its own kind, in spreads rather than inches, so that a father, a mother and a daughter can all go on one axis. Each point is one parent against one of their children.

Fit the line. Its tilt is the correlation between a parent and their child, and that number is the whole of what this lesson is about.

  • 1,868 points: every child paired with each of its parents in turn.
  • Women's heights are multiplied by 1.08, exactly as Galton did.
  • Across: the parent, in spreads from the average. Up: the child.
  • The line goes through the middle of the cloud, so there is only the tilt to set. On these axes the tilt is the correlation between a parent and their child.
  • Under the graph: whatever correlation is still left in the part your line misses. Drive it to nothing and your line has taken all of it.
  • Heritability is twice this correlation — a child gets half its inheritance from the parent on the axis and half from the one not on it, so a single parent can only show you half the resemblance.
  • A correlation is the same thing Lesson 1 called an average error and Lesson 3 called a typical miss: how much less wrong you are about somebody once you are told something else about them. At 0.36 that is a guess about 7% better than blind.
parent–offspring correlation:  |  heritability, which is twice it:  |  correlation left over in what your line misses:

Controls

0.00

To open Stage C

  • Set the tilt until there is no correlation left over — under 0.02 either way. not yet
  • Answer the question below.
Stage C is open.
Your line's tilt is the correlation between one parent and their child. A child has two parents, so the heritability of height is twice it. What is it?
heritability

R code

g <- read.csv("data/clean/galton_families.csv")g$kid <- g$childHeight * ifelse(g$gender == "female", 1.08, 1)# every child against each parent in turnpar <- c(g$father, g$mother * 1.08)kid <- c(g$kid,    g$kid)# both in spreads, so the tilt is the correlationpz <- scale(par); kz <- scale(kid)tilt <- 0.00cor(pz, kz - tilt * pz)   # the tilt left overcor(par, kid)coef(lm(kz ~ pz))

C

Solve Stage B to unlock this section.

Sixty broods of nestlings, four to a nest. Each father sings, and each nestling learns the song from the bird in whose nest it wakes up. Nothing about the song is carried in any egg.

Turn up how carefully the nestlings copy, and watch two things at once: the nestmates in a brood start to sound like each other, and each nestling starts to sound like the bird that raised it.

Then swap the eggs between nests before any of them hatch, and ask both questions again.

  • Upper panel: one column per brood, one dot per nestling.
  • Lower panel: the song of the bird that did the raising, against the nestling's song.
  • Two gaps are reported: how far apart two nestmates sound, and how far apart two birds from different broods sound.
  • Sixty fathers leaves about 0.12 of noise on a single set, so the swapped sets get averaged as you go. Eight of them settles it.
  • With the eggs swapped, the bird that raised a nestling is not the bird it came from.
nestmates differ by · strangers by
resembles the bird that raised it:   resembles its own father:
swapped sets so far: 0   averaging:

Controls

0.30

To open Stage D

  • Get nestmates sounding less than half as different as strangers. not yet
  • Swap the eggs, then press New broods until eight different swapped sets average out to nothing for the father — while the raiser stays where it was. not yet
  • Answer the question below.
Stage D is open.
Any one swapped set is noisy — sixty fathers is not many. Averaged over your eight swapped sets, how much does a nestling resemble the father it actually came from?
correlation

R code

fid <- 0.30   # how carefully a nestling copiesfather <- rnorm(40)tutor  <- if (swap) sample(father) else fatherbrood  <- rep(1:40, each = 4)song   <- fid*tutor[brood] + sqrt(1-fid^2)*rnorm(160)cor(tutor[brood],  song)   # the bird that raised itcor(father[brood], song)   # the bird it came from

D

Solve Stage C to unlock this section.

Now a trait that every gene in the population agrees about. Four limbs, in every individual, specified as thoroughly as anything in the body is specified.

The variation comes from somewhere else entirely. Some of them lose a limb — a fall, a predator, a machine. Turn the accident rate up and there is plenty of variation to look at.

Then ask whether the accidents happen to fall in the same families, and watch what that does to the parent–offspring correlation.

  • 400 parent-and-child pairs. Everyone starts with four.
  • Across: the parent's count. Up: the child's. Points are jittered so you can see how many sit on top of each other.
  • The second knob decides whether some families are more dangerous places than others.
  • The genes never change. Only where the accidents land.
parent–offspring correlation:  |  missing a limb:  |  spread of the counts:

Controls

0.25
0.00

To open Stage E

  • With danger spread evenly, get a quarter of them missing a limb and the correlation still under 0.10. not yet
  • Now make danger run in families, and get the correlation above 0.30. not yet
  • Answer the question below.
Stage E is open.
Put danger back to spread evenly and run a few sets of families. What parent–offspring correlation does a trait every gene agrees about produce?
correlation

R code

# every individual is built with fourrate <- 0.25clus <- 0.00danger <- rnorm(400)p <- pnorm(qnorm(rate) + clus*danger)par <- 4 - rbinom(400, 1, p)kid <- 4 - rbinom(400, 1, p)cor(par, kid)

E

Solve Stage D to unlock this section.

So far every correlation has been a parent against a child. There are other pairs of relatives, and each of them shares a different amount of what a parent hands down.

One knob here — the heritability — and four kinds of relative: a parent and a child, two full siblings, two half siblings, and two first cousins. Turn it and all four move together.

The two marks on the axis are Galton's, from the real families in Stage B: what one parent and a child actually measured, and what two siblings actually measured. Find the setting that puts your first two rungs on them.

  • 3,000 families of each kind, rebuilt every time you move the knob — enough that the rungs stop wobbling.
  • Each rung is the correlation between that pair of relatives, measured the same way as Stage B.
  • A parent and a child share half their inheritance, so their rung sits at half the heritability. Work out what the other three should be before you look.
  • Galton's real numbers: one parent and a child 0.36, two siblings 0.40.
  • Watch what happens to each rung as you go down the list.
one parent and a child:  |  Galton measured 0.36  |  half your heritability would be

The four rungs

Controls

0.20

To open Stage F

  • Put the parent-and-child rung on Galton's 0.36. not yet
  • Answer the question below.
Stage F is open.
At that setting, what is the correlation between two first cousins?
correlation

R code

h <- 0.20kid <- function(a, b) (a+b)/2 + sqrt(h/2)*rnorm(length(a))seen <- function(g) g + sqrt(1-h)*rnorm(length(g))# each rung is the same fit as Stage B, on a different paircor(seen(father), seen(kid(father, mother)))# theory, for a check: h/2, h/2, h/4, h/8

F

Solve Stage E to unlock this section.

Three populations, one knob each. In the first, a child gets half of what its parents were built with. In the second, a child copies whoever raises it. In the third, a parent and a child simply live under the same roof and it does the same thing to both.

Set all three knobs until the three correlations are the same number. Then look at the three scatters and decide which is which.

Then swap the babies between families at birth, keep comparing each child to the parents it came from, and look again.

  • 2,500 parent-and-child pairs in each population, measured exactly as in Stage B.
  • The three knobs are not on one scale — they are three different mechanisms. The correlation each produces is what is comparable, and that is what you are matching.
  • They count as matched when the three correlations are within 0.05 of each other and all near 0.36.
  • Swapping the babies moves a child's copying and a child's roof. It cannot move what the child was built with.
correlations — built in:   copied:   shared roof:
widest gap between them:

Controls

0.20
0.20
0.20

To finish the lesson

  • Bring all three correlations within 0.05 of each other, near 0.36. not yet
  • Swap the babies, and watch two of the three go. not yet
  • Answer the question below.
With the babies swapped, one of the three correlations is still standing. What is it?
correlation

R code

h1 <- 0.20   # built inh2 <- 0.20   # copied from the raiserh3 <- 0.20   # shared roof# swapping cannot reach into the first onegk <- gp/2 + sqrt(h1*0.75)*rnorm(n)k2 <- h2*if(swap) sample(p2) else p2k3 <- h3*if(swap) sample(roof) else roofc(cor(P1,K1), cor(P2,K2), cor(P3,K3))