I have the following table:
> platform_marketing
Date marketing_segment channel conversion
1 2021-01-01 Child 2-12 1 1.0000000
2 2021-01-01 People with babies 1 11.0000000
3 2021-01-01 Child 2-12 1 4.0000000
4 2021-01-02 Big size 1 0.5000000
5 2021-01-02 People with babies 1 0.5000000
6 2021-01-03 Child 2-12 1 1.0000000
7 2021-01-03 People with babies 1 7.0000000
8 2021-01-03 People with babies 1 1.0000000
9 2021-01-03 Big size 1 1.0000000
10 2021-01-04 Child 2-12 1 2.0000000
11 2021-01-04 Not set 1 1.0000000
Where channel is either 1 or -1. Now I for example want to know what the average conversion is, given channel = 1. Also, I would like to know how this difference between the marketing_segments. Thus, I would like a table which looks like:
Channel marketing_segment avg_Conversion
1 Child 2-12 3.2
1 People with babies 1.6
1 Big size 6.4
1 Not set 0.5
-1 Child 2-12 1.5
What is the easiest way to obtain this information?