**0**wrote:

I have a question related to example 9.6.2 in the Limma User's Guide. The example describes how to find genes whose behavior over time is different between two conditions, where each condition has a decent number of time-points.

Reproduced here:

```
X <- splines::ns(targets$Time, df=5)
Group <- factor(targets$Group)
design <- model.matrix(~Group*X)
fit <- lmFit(y, design)
fit <- eBayes(fit)
topTable(fit, coef=8:12)
```

Columns 8:12 of the design matrix correspond to the interaction terms between group and time.

What if I also want to find the genes whose average expression differs between conditions, adjusting for time? Is there a way to do this using the above design matrix? Currently I'm proceeding as follows:

```
X <- splines::ns(targets$Time, df=5)
Group <- factor(targets$Group)
design <- model.matrix(~Group + X)
fit <- lmFit(y, design)
fit <- eBayes(fit)
topTable(fit, coef=2)
```

Column 2 of the design matrix corresponds to group. This method appears to give sensible results, but any advice would be appreciated. Thanks.

Jake