I have the following data:
I have a data.frame and I need to calculate the mean per a_id and b_id.
a_id b_id Rate1 Rate2
A 1 12 23
A 0 18 73
A 1 19 45
B 1 53 19
B 0 22 87
B 0 19 45
C 1 22 87
C 0 67 43
C 1 45 32
My desired output is like below
a_id b_id Rate1
A 1 15.5
A 0 18
B 1 53
B 0 20.5
C 1 22
C 0 33.5