how to decide whether intercept term is necessary for GLM model or not
1
1
Entering edit mode
10.4 years ago
illinois.ks ▴ 210

Hello,

I have read several materials including the edgeR and GLM manual. I am wondering whether I need to add intercept into the mode.

I am reading the edgeRUserGuid maual..for example, suppose we have such data composing from 12 samples..

> targets
Sample Treat Time
1 Sample1 Placebo 0h
2 Sample2 Placebo 0h
3 Sample3 Placebo 1h
4 Sample4 Placebo 1h
5 Sample5 Placebo 2h
6 Sample6 Placebo 2h
7 Sample1 Drug 0h
8 Sample2 Drug 0h
9 Sample3 Drug 1h
10 Sample4 Drug 1h
11 Sample5 Drug 2h
12 Sample6 Drug 2h

Two Design matrix looks like this..

> Group <- factor(paste(targets$Treat,targets$Time,sep="."))
> cbind(targets,Group=Group)

> design1 <- model.matrix(~0+Group)

> colnames(design1)

[1] "GroupDrug.0h"   "GroupDrug.1h"    "GroupDrug.2h"    "GroupPlacebo.0h" "GroupPlacebo.1h" "GroupPlacebo.2h"

> fit1 <- glmFit(y, design1)

> design2 <- model.matrix(~Treat + Treat:Time, data=targets)

> colnames(design2)
[1] "(Intercept)" "TreatDrug"
[3] "TreatPlacebo:Time1h" <strong>"TreatDrug:Time1h"</strong>
[5] "TreatPlacebo:Time2h" "TreatDrug:Time2h"

> fit2 <- glmFit(y, design2)

What is the difference for

glmLRT(fit1, coef=2)

VS.

glmLRT(fit2, coef=4)

Are they testing the same thing, which find genes resposive for Drug at time 1h...(compared to time 0).?????????????? If it is same, I think there is no reason for intercept term. If it is not, what is the difference for those tests??

RNA-Seq • 6.6k views
ADD COMMENT
4
Entering edit mode
10.4 years ago

They're in no way the same thing. Without an intercept, you're basically asking of a gene has signal above 0 in a particular group (i.e., glmLRT(fit1,coef=2) is unlikely to answer your biological question). If you want to compare (i.e., contrast) a number of the groups, such as GroupPlacebo.1h vs. GroupDrug.1h, then not having an intercept can make that a little easier.

I should note that times like this are when having taken a bit of linear algebra comes in quite handy. If you're affiliated with a university and have never taken linear algebra, I would highly recommend it. You'll find many statistical procedures (such as what a model matrix is actually doing) much simpler then.

ADD COMMENT
0
Entering edit mode

Thank you so much!!.. Yes, I will try to find some extra material.. ;)

ADD REPLY

Login before adding your answer.

Traffic: 2689 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6