###################################################
# Reproducing an example of Weir & Cockerham (1969)
###################################################
# Pedigree
x = nuclearPed(2, sex = 1:2) |>
addDaughter(3:4) |>
addSon(c(3,5)) |>
addDaughter(5:6) |>
relabel(new = strsplit("GHDECBA","")[[1]])
plot(x)
# The two-locus inbreeding of A
twoLocusPlot(list(ped = x, ids = "A"), coeff = "inb")
# W&C formula (expressed by linkage parameter a = 1-2*rho)
rho = seq(0, 0.5, length = 11)
a = 1 - 2*rho
WC = (128 + 10*a + 36*a^2 + 47*a^3 + 20*a^4 + 10*a^5 + 4*a^6 + a^7)/512
points(rho, WC, col = 2)
Run the code above in your browser using DataLab