I have a data like the following and I want to know the percentage of people who have bought from more than 2 brands:
hh_code brand
3032145 536
3032145 53
3032145 534
324063 536
204128 53
84787 536
and I want to the number of brands bought by each household - like the following:
hh_code unique_ brand
3032145 3
847827 1
204128 1
84787 1
I have tried using table but it is just giving me frequencies. Would appreciate any insights!