I have the following data:
dat <- data.frame(ID=1:4,q1=c(2,3,2,3),q2=c(3,2,2,4),q3=c(2,2,3,5),q4=c(4,4,4,6))
ID q1 q2 q3 q4
1 2 3 2 4
2 3 2 2 4
3 2 2 3 4
4 3 4 5 6
I need to have :
- the mean of q1 and q3; the mean q2 and q4
- the mean of q1 and q2; the mean of q3 and q4
E.g. - for the first one: 2+2/2= 2 (q1+q3) ...etc for each row