This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Compare samples that don't have a coefficient on the design matrix

I have some data that I model with 4 factors, each one have two levels. However, I need to compare some samples based on a fifth factor that is not included on the model:

Here I provide an example design matrix:

groups <- paste(c("f1A", "f1B", "f1A", "f1A", "f1B", "f1A"),  
               c("f2B", "f2B", "f2A", "f2A", "f2B", "f2B"),  
               c("f3A", "f3A", "f3B", "f3B", "f3A", "f3A"),  
               c("f4A", "f4B", "f4A", "f4B", "f4A", "f4B"), sep = "_")

m <- model.matrix(~ 0+groups, as.factor(groups))
colnames(m) <- levels(as.factor(groups))
m
f <- c("H", "G", "H", "G", "H", "G")

Here I want to compare F and G but they are not on the model (m). Assuming that I cannot make them with the coefficients present on the design, how can I compare them? Do I need to build another design matrix?

r comparisons linar-model

0 answers

No answers yet.

Log in to answer this question.