Compare samples that don't have a coefficient on the design matrix
0
0
Entering edit mode
4.4 years ago
Lluís R. ★ 1.2k

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 • 505 views
ADD COMMENT

Login before adding your answer.

Traffic: 3239 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