設計矩陣
Doxorubicin 的實驗是 2x2 的因子設計,因此你需要建立一個合併後的變數,才能在群組平均(group-means)參數化中使用。
本練習屬於課程
使用 R 中的 limma 進行差異表達分析
練習說明
已在你的工作環境中載入含有 doxorubicin 資料的 ExpressionSet 物件 eset。
將
genotype(WT 與 Top2b null)與treatment(PBS 與 Dox)這兩個變數合併成單一的因素變數。使用
model.matrix建立一個沒有截距的設計矩陣。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Create single variable
group <- with(___(eset), paste(___, ___, sep = "."))
group <- factor(group)
# Create design matrix with no intercept
design <- model.matrix(~___ + ___)
colnames(design) <- levels(group)
# Count the number of samples modeled by each coefficient
colSums(design)