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 3

This week we will cover modeling non-continuous outcomes (like binary or count data), hypothesis testing, and multiple hypothesis testing.

- Jeff Leek, PhDAssociate Professor, Biostatistics

Bloomberg School of Public Health

A common occurrence in genomic and genetic data is that the outcome is

Â actually a binary variable rather than a continuous variable.

Â In that case one option is logistic regression.

Â So as an example of this, I'm going to illustrate it with a case-control study.

Â So suppose that you've collected a large number of cases, say a large number of

Â cases of people with cardiovascular disease and an equal number of controls.

Â So people that don't necessarily have had cardiovascular disease or

Â at least not measurably.

Â And then you genotype them in a bunch of loci.

Â For one particular locus, imagine that you can either have a C or a T,

Â then you can build this two by two table that says, if you're a C or

Â a T and if you're a case for control.

Â So then the next thing that you might want to ask is,

Â are those two variables related to each other?

Â So one option for

Â doing this is you could just fit the standard linear regression model.

Â So you could relate the case control status which is either a 0 or

Â a 1, to the genotype which is equal to 0 or 1 as well if it's a C or

Â a T based on this linear regression model.

Â And then you'd have an error term just like you'd have before.

Â The problem is here you can imagine getting a model fit and an error term such

Â that that fit was outside of 0,1 even though the variable itself is 0 or 1.

Â Moreover, and you could get any continuous number for

Â this regression over here on the right, and

Â you actually only had two potential real values on the left-hand side.

Â So that doesn't make a lot of sense.

Â So the first step that you could make is to recognize that's not

Â a continuous variable and instead try to model the probability.

Â So you could model the probability that your case and

Â you could model that as a function of the genotype.

Â Here we've now eliminated this error term because we're not modeling this

Â continuous variable anymore, we're just modeling a probability.

Â So we have some model here for that probability.

Â The only problem is, is that probability's always between zero and one.

Â And so, if you fit a linear regression model you might get values that are larger

Â than one or smaller than zero.

Â So another way they you could do this is you could take the log of the probability.

Â So that if you set the probability that the case is equal to 1,

Â equal to the variable p, and

Â you model the log of that probability as a linear function of the genotype.

Â This works a little bit better because this can have values between

Â negative infinity and zero which is now more like a continuous variable, and

Â you'll capture more of it with the regression model.

Â But you can go even farther, you can actually model the log odds.

Â So here we're going to model again the probability that your case is p.

Â So we're going to do p divided by 1 minus p.

Â So that variable can take on a larger number of values and

Â the log of that variable can take on any value between minus infinity and infinity.

Â This now, makes sense for a continuous regression model like we have here that's

Â regressing on the basis of the genotypes.

Â But now, we have a little bit of difficulty because we're modelling

Â a relationship about the log of a variable versus the genotype.

Â And so what are the coefficients that we're estimating now?

Â This coefficient is interpreted as the increase and

Â log odds of case status given a genotype.

Â Let's talk a little about odds and log odds.

Â They're a little bit tricky to interpret.

Â So let's start off with a simple example.

Â Imagine that you can have one of three genotypes.

Â You can either have two copies of the major allele, one copy of the major allele

Â and one copy of the minor allele or two copies of the minor allele.

Â Suppose that in this case,

Â the phenotype that we're after is whether you died or not.

Â So suppose that there's a 33% chance you die if you have two copies

Â of the major allele, 50% chance if you're a heterozygote, and

Â 90% if you're homozygous for the minor allele.

Â So then what we can do is we can calculate the probability of that phenotype for

Â each of these different genotypes.

Â The odds then is the ratio of the probability of death

Â to the probability of not death.

Â So in this case it's one to two is the odds,

Â one over two is the odds of death here.

Â In this case, since it's a 50,

Â 50 chance the odds is actually equals to one, it's just a ratio of one to one.

Â And in this case, the probability of death is 90%, and

Â the probability of not dying is 10%.

Â And so the odds is actually 9 over 1 or 9.

Â So the odds is a number that can range from zero to basically infinity.

Â It could be as big as you want depending on what this probability is.

Â So the log odds is then going to be the log of that number,

Â it's going to range between minus infinity infinity.

Â So here's an example of what an odds ratio of two looks like for

Â a continuous variable.

Â So on the x axis here, we have the variable x and

Â it ranges in values from minus three to three.

Â And then we have the probability of surviving over ten years.

Â So again, that's just this little value is the probability of death,

Â if you have a covariate value of minus three.

Â And then say at this point,

Â this is the probability of death if you have a covariate value of zero.

Â And so what you're doing here is you're looking at the change in the probability

Â of death associated with this covariate follows this logistic curve.

Â So you can see that this is the characteristic sort of logistic

Â curve that you get when you're modeling things on this scale.

Â And so for an odds ratio too, you can see that there's a relatively linear decline

Â here in the middle and then at the ends it flattens out.

Â The change in the in a sort of odds adept.

Â So you can actually look at what these odds ratio look like for different values.

Â So imagine that you have an odds ratio of one.

Â That's basically just this flat line.

Â That means the odds aren't changing over time.

Â It's just flat.

Â Odds ratio of four looks something like this.

Â It's starting to look like a curve, like that.

Â And an odds ratio of infinity or an undefined odds ratio,

Â looks almost like a step function here.

Â Where at some point, the odds just change.

Â It goes from basically a probability of zero to a probability

Â of one at some very specific point.

Â So this is the way that we can model continuously the odds or log odds.

Â So how do we interpret that from the model?

Â So the log odds is the log of the probability of being a case

Â divided by 1 minus the probability of being a case.

Â And the odds is just that exponentiated.

Â So you can actually get that from the coefficients in the logistic

Â regression models.

Â So the b coefficient and logistic regression code model is a log odds value.

Â And if you exponentiate that, you actually get the odds.

Â So again, recall that the log odds can range from minus infinity to infinity and

Â the effect of no effect is defined as to be 0.

Â So if you get a log odds of 0 that's no effect, if you get a log odds of minus 1

Â or plus 1, then you have a change in the probably in one direction or the other.

Â The odds on the other hand remember,

Â if it's a 50, 50 chance that's just equal to an odds of 1.

Â So that means that there's no change.

Â And [COUGH] so these two values correspond to each other.

Â So this is again, a version of a generalized linear model

Â which actually is a whole other course in regression modeling.

Â And we're not talking about that in and in too much detail here,

Â we're going to go through an example with our code, but the basic

Â idea is that you're trying to model things on the natural scale for that variable.

Â So here's a nice set of lecture notes on generalized linear models

Â including a whole bunch of r code if you want to learn a little bit more about it.

Â This is a huge topic and we've only really scratched the surface.

Â But it's a really commonly used model and things like genome-wide association

Â studies and so it's worth knowing a little bit about.

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