Hello. In this
example, we will
calculate the estimation of coefficient
of heritability using analysis of
variance on performance values in
related individuals.
In our case, we use groups
of half sibs by sires.
40 progeny were chosen at random.
Each sire mated to 8 dams, with each
mating producing one male.
Five sire families were chosen at
random and progeny 8 week
body weight in grams
obtained.
Genetic variances and heritability
are to be estimated. We use
analysis of variances.
In the first table we can see 40
individuals values of performance.
In this statistical analysis we use
simple linear model with one
effect of fathers.
Our linear model is "y" which is the
performance rate of the jth offspring
and this "y" is equal to means
plus the effect of i-th
father
plus the residue of
ei.
These are random effects that we are
unable detect and include in the
calculation.
To simplify the manual calculation, we
don't have to perform all the basic
operations. We have them pre-calculated
in the second table, where the sum
groups, sums of squares and
squares of sums are shown.
Also the total sums.
We then use these values in the
equations to calculate the sum of squares
of deviations from the mean.
For calculation we use program
R and Rstudio which
you can see on your left.
We have written the impute values as
objects with name.
A large Y squared means the
square of the total sum.
The next value is the square of the sum
for the group divided by the number of
individuals in the group and summed
over all groups.
The third value is the sum of squares of
the individual values for the
entire data set.
P is number of fathers,
5, N is number of
individuals, 40,
and n0 is weighted
number of offspring per sire.
These objects must be loaded into the
computer's memory by selecting them with
the mouse and running the script by
pressing the Control and
Enter key combination.
We must now calculate the sum of squares
of the deviation from the mean according
to the linear ANOVA equation
first. We calculate the sum of squares
of the deviations from the mean between
groups of half sibs. It is between
the fathers. We name them
SSA.
The result is displayed by pressing the
Control key and Enter.
Next, we compute the sum of squares
of the deviations from the mean
within the groups of half sibs
SSE.
After creating the script according to
the formula, we mark it and run
it. Again we can see the
results below.
The next step is to count the mean of
square, which are the
variances,
and again we calculate the
mean of square MSa
between groups and mean of
square residual MSe
within groups.
We calculate the mean of square between
groups of fathers MSa
by dividing SSa by the degrees of
freedom. In this case
is d the number of fathers
minus 1.
We obtain the residual mean of
square MSe by dividing
SSe by the degrees of freedom.
It is the number of offspring minus
the number of sires.
And this is the result of statistical
analysis of variance.
The genetic part follows where the last
column of the ANOVA table describes
the composition of the mean of square.
The genetic variance contain it in mean
of square of sires MSa
and MSe residual mean
of square directly equal to the
environmental variance.
We can, therefore, estimate the
genetic variance as the difference
between variance between
sires, MSA, and
variance residual,
MSE. And this
difference is divided by n0 -
weighted number of offspring per sire.
So our genetic variation by
sire is.
245.7
So, let's write down that the
environmental variation is directly
equal to the MSE, residual
mean of square.
We have now calculated both
components of variation,
genetic and environmental.
From these both variations we have
to calculate the so-called intraclass
correlation coefficient.
We will mark this with an R
or rho.
This coefficient is equal to genetic
variation divided by the total
phenotype phenotypic variance, which is
the genetic plus environmental
variance.
This equation is very reminiscent of the
heritability, because heritability is
defined as proportion of genetic variance
to total phenotypic variances.
Why is that not heritability?
It is because we are calculated
based on groups of half sibs.
The value of heritability, h^2,
is straight four times this
intraclass correlation coefficient. The
reason is simple, because the genetic
similarity between half sibs
are 25%, 1/4.
We also have to calculate the value of
the standard error of estimation of the coefficient of
heritability. The formula is again
in the Word document.
As you can see, the
standard error of estimation of
heritability
is very high -
0.556.
In order for us in that calculated value
of heritability we get a little bit of
faith, so the standard error would have
to be less than 0.05.
In our case, far from it.
It's because it's only a model example.
We have got a little offsprings, few
groups of half-sibs,
which is why the standard
error is so high.
If we use a statistical software like R,
we don't have to calculate ANOVA
manually, but we can use the function.
But first, you have to load the data.
We have the database prepared in Excel
spreadsheet that is available to you,
so you can... It is
very simple. In RStudio
load the data. So we
are gonna put FILE up here.
We will put Import dataset and select the
menu From Excel. We
will find our Excel file.
As you can see we have already got the
data. The table is loaded nicely.
I have a father, sire here in
the ABCD form and in the second
column are the values of the
offspring. We call this data
data1. We will
just put import.
We write object ANOVA1
and we use function lm, linear
model, which is the basic function in
R. We have to define
model equation. "y"
is equal to one effect,
effect of sire. It's
not used here a call to but the
so-called tilde or the waveform.
Write Alt+1 on alphanumeric
keyboard. To view the
result, let's write down
ANOVA and in parenthesis
ANOVA1. When I
tag it and run it, we see the
results in couple of steps,
actually in two lines. We have
the resulting table of analysis of
variance. Notice that here are
the degrees of freedom, paternal
or between groups, and the residual.
Then there is the sum of squares of
deviations from the mean.
The last third column is crucial for us.
There are mean of squares
between and within groups.
You can see that this is absolutely the
same as we can calculate it manuály before.
This is where the analysis of variance
ends and then the genetic analysis comes
in. So we
should calculate genetic variances,
environmental variances and then
coefficient of correlation and from this
coefficient, coefficient of heritability.
At the end we will show a second analysis
where we use the REML method. Here we
have to load or install and load
special package lme4.
You install the package using the package
folder.
I have already installed it, so I just
activate it by typing library
and the package name.
Here we will use the lmr
function that is in the package
lmf4 and
again we have to define the simple
equation. So again
"y" tilde
1 plus and in
brackets it will be
one, perpendicular line and
then we will write sire.
Let's also write that the data is Data1
to get the result back
displayed, so we will write a summary of
our REML1 calculation.
And if we work it
and put Ctrl key and Enter, we will
see the overall table for this analysis,
where we can notice that these two lines
are important to us when, as you can
see, us directly this
calculation REML calculated directly the
genetic variation by sire.
There is also environmental
variation. We then
process them in the same way. It is we
calculate the coefficient r and
from it the heritability.
And thank you for your attention.