Pairwise t test with 3 vectors

The pairwise.t.test needs a grouping factor or ‘g’. In this case, the individual vectors can be converted to a named list with mget, then reshape it to a two column data.frame with stack and then use pairwise.t.test

with(stack(mget(paste0("x", 1:3))), 
     pairwise.t.test(values, ind, p.adj = 'bonferroni'))
#   Pairwise comparisons using t tests with pooled SD 

#data:  values and ind 

#   x1   x2  
#x2 0.79 -   
#x3 0.44 1.00

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top