Contrast Matrix to Compare Treatments While Accounting for Baseline

10 views
Skip to first unread message

Frank Fabela

unread,
Jul 21, 2026, 10:32:06 PM (5 days ago) Jul 21
to MSstats
Hello, 

I am looking for some guidance setting up my comparison matrix to determine differences between treatments while accounting for pre-treatment baseline levels. My first treatment has a temperature component "HS" and my second treatment has two components temperature + protein inhibitor "Inh". They both have the same baseline measurement "BL". There is also a time component with experimental measurements taken over two days "XP1" and "XP2".  I am comparing changes seen in each treatment to the baseline.

My comparison matrix is set up in the attached image; however, I do not think my last two comparisons are set up for what I want to compare. 

I want to compare the differences seen in "HS-BL" to the differences seen in "Inh-BL". Can you help me set this up? 

Code to set up this matrix is as follows:

comp1 <- matrix(c(-1,1,0,0,0),nrow=1)
comp2 <- matrix(c(-1,0,1,0,0),nrow=1)
comp3<-  matrix(c(-1,0,0,1,0),nrow=1)
comp4 <-  matrix(c(-1,0,0,0,1),nrow=1)
comp5 <- matrix(c(-2,1,1,0,0), nrow=1)
comp6 <- matrix(c(-2,0,0,1,1), nrow=1)
trt_compare<- rbind(comp1,
                     comp2,
                     comp3,
                     comp4,
                     comp5,
                     comp6)
row.names(trt_compare) <- c("XP1_HS-BL", "XP1_Inh-BL", "XP2_HS-BL","XP2_Inh-BL", "(XP1_Inh-BL)-(XP1_HS-BL)", "(XP2_Inh-BL)-(XP2_HS-BL)")
trt_groups<- as.matrix(c("BL", "XP1_HS", "XP1_Inh", "XP2_HS", "XP2_Inh"))
trt_groups
colnames(trt_compare) <- trt_groups
trt_compare

Thank you so much!

-Frank Fabela

Frank Fabela

unread,
Jul 25, 2026, 1:44:39 AM (2 days ago) Jul 25
to MSstats
Screen Shot 2026-07-24 at 10.41.43 PM.png
Reply all
Reply to author
Forward
0 new messages