I plan to do t.test for q1,q2,q3
by group A&B
in df
q1 q2 q3 group
1 0 1 A
0 1 0 B
1 1 1 C
0 1 0 B
If only 2groups, I can use t.test(q1~group,df)
lapply(d[,-4], function(i) t.test(i ~ d$group))
,but how to do t.test between group A & B
when I have 3 groups?