So one way that you can model this is to try to model it as a continuous variable.
You could say the number of copies in the minor allele is zero for
the homozygous major allele, one for the heterozygote, and two for
the majoma-zygote minor allele.
In that case you can still fit a linear regression line, just like you did with
the previous lecture, but now you have a specific interpretation.
That is, the difference between the homozygous major allele and
the heterozygote is Beta, and the difference between the heterozygote and
the homozygous minor allele is also Beta, so
you force that difference to be exactly the same for those two cases.
With a categorical variable, you could just code it differently, and
get a different linear regression model.
And this corresponds to basically fitting different means,
so here's a way that you can do that.
Suppose that you defined a variable that's equal to
one if G is not equal to a homozygous major allele, and
it's equal to zero if it is equal a homozygous major allele.
In that case, you have zero of homozygous major, and one if not.
And what you get is a model that looks like this, you're still fitting a linear
regression model, but now that's equivalent to fitting two different means.
The first mean is the mean for the homozygous major allele,
that's equal to Beta0 because this value is equal to zero.
So if this value is equal to 1 then you have a value of 1 here,
and that's equal to Beta0 plus Beta.
So Beta0 plus Beta is equal to the average value for
the heterozygote and the homozygous minor allele.
Similarly, you could fit a recessive model where you actually set a covariant here,
this should be G equals to little a, little a, sorry for that typo.
And so what you can see is in that case, it's equal to one,
when you have homozygous minor allele, and it's equal to zero otherwise.
That's, again,
quivalent to just fitting two mean levels by fitting the regression model.
And so, you're fitting a linear regression but you get a value of Beta0,
and this covariant is zero, so that's the average value of homozygous major allele,
and the heterozygote, and you get a value of Beta0 plus Beta.
You get this value when the covariant is equal to one, so that's the case for
the homozygous minor allele.