**10**wrote:

Hi,

I am comparing two paired groups. **Should I follow 9.4.1 paired samples in the user guide or 9.7 in the user guide?** [I know 9.7 is for mixed of independent and dependent factors. But two paired group is a special case of 0 independent and 1 dependent factor, so 9.7 should be right also for two paired groups.] I actually think 9.7 is the mixed effect model, thus 9.4.1 (paired t test) should be a special case of 9.7. But from the following test, I am apparently wrong somewhere.

My small simulation study is following,

y = matrix(rnorm(2*10), nrow=2) treat = factor(rep(c("T1","T2"),5)) subject_id = rep(c("A","B","C","D","E"), each = 2) design <- model.matrix(~0+treat) colnames(design) <- levels(treat) # 1 corfit <- duplicateCorrelation(y,design,block=subject_id) fit <- lmFit(y,design, block = subject_id, correlation = corfit$consensus) cm <- makeContrasts( Diff = T2-T1, levels=design) fit2 <- contrasts.fit(fit, cm) fit2 <- eBayes(fit2) topTable(fit2, coef="Diff") logFC AveExpr t P.Value adj.P.Val B 1 -0.7933632 -0.1601572 -1.837463 0.08478521 0.1695704 -4.118469 2 -0.3660406 0.1586736 -1.025867 0.32021504 0.3202150 -4.955690 # 2 design <- model.matrix(~subject_id+treat) fit <- lmFit(y, design) fit <- eBayes(fit) topTable(fit, coef="treatT2") logFC AveExpr t P.Value adj.P.Val B 1 -0.7933632 -0.1601572 -1.668410 0.1345112 0.2690224 -4.295977 2 -0.3660406 0.1586736 -1.166903 0.2774725 0.2774725 -4.686874 # 3 t.test(y[1,]~treat, paired = TRUE) t = 1.4203, df = 4, p-value = 0.2286

They return different p value. Why? And which one is more appropriate?

**24k**• written 15 months ago by fansili2013 •

**10**