next up previous
Next: Creative Commons License

Partitioning variance with WinBUGS

As you have already guessed, there is a way to partition variance with WinBUGS. One of the advantages of using WinBUGS for variance partitioning is that it is easy to get direct estiamtes of both the observational and the causal components of variance in a quantitative genetics design.1

The data has a fairly straightforward structure, although it will look different from other WinBUGS data you've seen:

   sire[] dam[] weight[]
   1 1 99.2789343018915
   1 1 92.8290811609914
   1 1 92.1977611557311
   1 1 96.2203721102781
   1 1 97.435349690979
   1 1 99.5683756647001
   1 1 92.2818423839868
   1 1 99.5110665900414
   1 2 103.230303160319
   .    .     .
   .    .     .
   .    .     .
   7 52 102.100956942292
   7 53 117.842216117441
   7 53 124.174111459722
   7 53 115.02591859104
   7 53 111.885901553834
   7 53 115.320308219732

The first column is the number of the sire involved in the mating, the second column is the number of the dam involved in the mating, and the last column is the weight of an individual offspring.

Recall that our objective is to describe how much of the overall variation is due to weight differences among individuals that share the same mother, how much is due to differences among mothers in the average weight of their offspring, and how much is due to differences among fathers in the average weight of their offspring. One way of approaching this is to imagine that the weight of each individual is determined as follows:

\begin{displaymath}
\mbox{weight}_i = \mbox{mean}(\mbox{weight})
+ \alpha (\mbo...
...n})
+ \beta (\mbox{dam contribution})
+ \mbox{error} \quad ,
\end{displaymath}

where $\alpha$, $\beta$, and $\hbox{error}$ are normally distribtued random variables with mean $0$ and variances of $V_s$, $V_d$, and $V_w$, respectively. We can translate that into WinBUGS code like this:

  # offspring
  for (i in 1:300) {
     weight[i] ~ dnorm(mu[i], tau.within)
     mu[i] <- nu + alpha[sire[i]] + beta[dam[i]]
  }

  # sires
  for (i in 1:6) {
     alpha[i] ~ dnorm(0.0, tau.sire)
  }
  alpha[7] <- -sum(alpha[1:6])

  # dams
  for (i in 1:52) {
     beta[i] ~ dnorm(0.0, tau.dam)
  }
  beta[53] <- -sum(beta[1:52])

  # precisions
  tau.sire <- 1.0/v.sire
  tau.dam <- 1.0/v.dam
  tau.within <- 1.0/v.within

Why the funny precisions, tau.sire, tau.dam, and tau.within? It turns out that it was easier for the people who wrote WinBUGS to describe normal distributions in terms of a mean and precision, where precision $=$ 1/variance, than in terms of a mean and variance.

Then all we need to do is to put appropriate priors on nu, v.within, v.dam, and v.sire. The most convenient way to put priors on the variance components is to put a uniform distribution on the corresponding standard deviations.

  # priors
  nu ~ dnorm(0, 0.001)
  sd.sire ~ dunif(0, 10)
  sd.dam ~ dunif(0, 10)
  sd.within ~ dunif(0, 10)

  # observational components
  v.sire   <- sd.sire*sd.sire
  v.dam    <- sd.dam*sd.dam
  v.within <- sd.within*sd.within

If you put this all together in a WinBUGS model, then WinBUGS will produces results like those shown in Table 1.2


Table 1: Estimated variance components from the full-sib data.
Variance component Estimate (2.5%, 97.5%)
v.sire 8.18 (1.306, 31.29)
v.dam 4.571 (2.281, 7.974)
v.within 11.48 (9.599, 13.68)





next up previous
Next: Creative Commons License
Kent Holsinger 2006-10-22