An introduction to the statistics behind the most popular genomic data science projects. This is the sixth course in the Genomic Big Data Science Specialization from Johns Hopkins University.

Loading...

From the course by Johns Hopkins University

Statistics for Genomic Data Science

115 ratings

An introduction to the statistics behind the most popular genomic data science projects. This is the sixth course in the Genomic Big Data Science Specialization from Johns Hopkins University.

From the lesson

Module 2

This week we will cover preprocessing, linear modeling, and batch effects.

- Jeff Leek, PhDAssociate Professor, Biostatistics

Bloomberg School of Public Health

In a previous lecture, we talked about linear regression models

Â with continuous outcomes and continuous covariates, but in genomics,

Â you often have either non-continuous outcomes or non-convariates.

Â In this lecture, we're going to be talking about the case where you have a continuous

Â outcome, but maybe a not continuous covariate or a categorical covariate or

Â a factor-level covariate.

Â So here's a simple example.

Â Suppose you're trying to relate the levels of cholesterol as measured continuously,

Â to the genotype of a particular snip, where you either have homozygous dominant

Â or major allele, heterozygous, or a homozygous minor allele.

Â 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.

Â So by just changing the covariant definition,

Â we actually have changed the regression model, and

Â changed it from one where you're fitting a line to one where you're fitting means.

Â So the other thing that you can do is go fully flexible,

Â the two degrees of freedom model, and you can fit two different covariants.

Â The first covariant is only equal to one when you have a heterozygote.

Â The other covariant is only equal to one when you have a homozygous minor allele.

Â And so what does that mean?

Â That means Beta0 now corresponds to the value when both of these covariants

Â are zero.

Â That's homozygous major allele.

Â So Beta0 is the mean for the homozygous major allele.

Â Beta0 + Beta Aa is equal to the average value for just the heterozygous.

Â And similarly Beta aa is the average value, plus Beta0,

Â is equal to the average value for the homozygous' minor allele.

Â So now you've fit a fully flexible model where you've actually fit three different

Â means by including two covariants.

Â So this is a way that you can use a linear regression model

Â with categorical covariants to just fit mean levels to the different values.

Â You just have to be careful about how you define your covariants, and

Â what that means for the interpretation of the Beta coefficients.

Â Again this is a whole class on linear regression models, and

Â I encourage you to go check those things out.

Â The basic thing to keep in mind when dealing with categorical covariants

Â is how many levels do you want to fit?

Â How do you fit those in such a way that it makes sense biologically,

Â based on the assumptions that you have.

Â And there are great additional notes again in the edecs course on statistics for

Â the life sciences.

Â Coursera provides universal access to the worldâ€™s best education,
partnering with top universities and organizations to offer courses online.