Imagine we have a panel of inbred organisms with 10 strains and 50 organisms per strain.

# set constants
num_strains <- 10
num_obs_per_strain <- 50
h2 <- 0.5
num_obs <- num_obs_per_strain * num_strains
d <- data_frame(strain = factor(x = rep(x = 1:num_strains, 
                                        each = num_obs_per_strain)))

Imagine there is a phenotype that is 50% heritable in a panel of inbred organisms. That is to say, imagine 50% of the total phenotype variation is within strains and 50% is between strains. Here’s what that looks like:

to_plot <- d %>% 
  mutate(phenotype = rnorm(n = num_obs,
                           mean = rnorm(n = num_strains)[strain]))

Imagine there are two such phenotypes with no covariance:

Imagine there are two such phenotypes with some covariance.