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

One of the most common things that you do when doing a genomic data analysis is

Â you want to compare the fit of two models.

Â So, let me explain why that's most commonly come up.

Â So, imagine that you're fitting a regression model.

Â So, Y is some genomic measurement that you care about, and

Â you're fitting a relationship here that's a linear relationship of a phenotype and

Â say a batch variable that you're going to be adjusting for.

Â So, when you're fitting a regression model for genomic data, you're often not fitting

Â one regression model, you're often fitting many regression models.

Â And remember this colored blocks version of that regression model framework.

Â So here we have a genomic data set where going down the rows here are the genomic

Â features we measured and going across columns are the samples we have.

Â And so here in one particular row are the measurements say for one gene.

Â And we model that as a function of the coefficients for

Â that gene, multiplied by some primary variable, say the phenotype that you care

Â about plus some other set of coefficient times some adjustment variables.

Â Here this might be the batch effects, plus independent random variation.

Â So what we're trying to do here is we're trying to identify,

Â is there an association between these primary variables and the genomic data?

Â And so we might imagine fitting a couple of different models.

Â The first model would be that one,

Â where you've included all the different variables.

Â The null model in this case might be the case where there's no relationship between

Â the primary variables and the data, and so this term goes away.

Â In that case you end up with a simplified model that looks like this.

Â You're modeling the gene expression or

Â the other genomic data as a function of the batch variable alone.

Â So the phenotype is no longer included in the model.

Â And here we get different estimates, so I've indicated those with stars

Â because we're fitting a different model in this case.

Â So this model looks like this with the colored blocks.

Â You can see for a particular gene which is a row in this matrix here.

Â You get a particular row of coefficients times some adjustment variables

Â plus the random variation for that row.

Â But you no longer have the phenotype data because that's

Â not included in the null model.

Â So now we want to compare these two model fits and

Â see if one does better than the other.

Â So as a simple example, I'm going to look at a case where we're looking at various

Â different samples that are assigned to three different categories for

Â cancer status.

Â Biopsy, cancer, and normal.

Â And so for each of these different categories you get a gene expression

Â measurement for each gene.

Â So for one of those genes, I'm plotting the measurements across samples, so

Â each dot is a sample here.

Â So you can see, you can, the null model might be, say for this case,

Â that they're all exactly equal in expression.

Â And so the mean level is the same for all of them.

Â And so, in that case, you would fit a mean model that's just the average across

Â all of the different samples.

Â The alternative model then might include the cancer status in the model.

Â The phenotype in the model.

Â And so now you get a mean level for each of the different cancer statuses.

Â So the question that we might ask is, does this model,

Â the model where we include cancer status, fit much better than this model,

Â the one where we just fit an overall average?

Â So the question is how do we come up with the statistic to quantify that?

Â So one way that you can do that is with the residuals.

Â So here, the residual is defined as the actual data point, but

Â subtracting the model fit.

Â So in this case, model one is, we're, actually the alternative model we're

Â going to fit, is the one that includes both the phenotype and the batch variable.

Â So we're going to fit that model and we're going to calculate the residuals.

Â Basically subtract the model fit from the observed values.

Â For model two, we can do the same thing.

Â So we can take the observed data and

Â we can subtract off the model fit where we only included the batch variable.

Â So now we have two measurements of how close are the model fits to the real data.

Â You can actually look at that in the data example that I've shown.

Â So here I'm actually showing you the residuals for

Â the model fit where you just fit an overall mean, and

Â the residuals where you fit, case where you fit a mean for each different level.

Â So, here you can see that the residual sum of squares or

Â the distance from the actual values to the model fit value squared,

Â when you sum it up over all of the different values is equal to 22.05.

Â And here when you actually fit the model that includes a term,

Â an average in each of the different cancer statuses,

Â you actually get a lower value of this residual sum of squares.

Â Now, you should always expect that.

Â Whenever you include more variables in the model,

Â the residual sum of squares will go down.

Â It just doesn't go down enough to make us suggest that the model fit

Â is a better fit.

Â So this is the statistic that people use to quantify that.

Â So this is the commonly used F statistic.

Â So here are these RSS terms are the residual sum of squares where it's either

Â under the null model if there's a 0 or an alternative model if there's a 1.

Â So here we're taking the difference between the sum of square fits for

Â the null model and the alternative model.

Â And what does that mean?

Â So we know that the residual sum of squares under the null model,

Â the model where we don't include the phenotype variable,

Â will always be bigger because we've included fewer variables in that model.

Â So this term on the top is always positive and it quantifies basically how much

Â the residual sum of squares shrinks by including that variable in the model.

Â Then we've standardized that to the units of the alternative model fit.

Â So basically we're saying the alternative model fit

Â includes all the variables we might fit.

Â How many units of residual sum of squares

Â did we change by going from this null model fit to the alternative model fit?

Â And then there's this term over here in the front and

Â this basically quantifies the difference in the number of variables.

Â And this standardizes it so that when we change the number of variables we include

Â in the null and alternative models it standardizes this difference here.

Â So again here we have n the total number of samples that we have.

Â p1 is the total number of parameters in the model, the alternative model.

Â And p0 is the total number of parameters in the null model.

Â And so you can see here, we're dividing this difference here,

Â RSS0 minus RSS1 by the difference in the number of parameters in those two models.

Â And similarly, we're doing something down here.

Â We're standardizing this RSS1 by the total number of observations

Â minus the total number of parameters in that model.

Â So this standardization allows us to come up with a standard form for

Â the distribution of this statistic, just like standardizing to standard deviation

Â units for the t statistic, gave us that similar form.

Â So we can use this statistic to quantify, does the model fit for

Â the null model, fit substantially worse than the null model fit for

Â the alternative, or the model fit for the alternative model?

Â So again this can be moderated just like the t-statistic can.

Â So sometimes that residual sum of squares of alternative

Â model is actually like very small.

Â And actually that happens quite a bit in genomic data and so

Â you can again moderate the statistics so that you don't get the blow up of

Â the statistic for very small variability there.

Â Again, the Linear Models for Microarray Data paper has a very good

Â explanation of how these linear models are fit and

Â what a net statistic is as does the edge package vignette in Bioconductor.

Â So the edge package is one package that's very useful for

Â fitting these null and alternative models and comparing them,

Â especially if you don't care about the moderated part of the statistic.

Â This is just like the direct comparison that can be done with the edge package,

Â and the vignette very carefully explains how these two models are fit.

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