I have a dataset of one categoric variable "supermarket" for each individual person and multiple "product" categories per person and supermarket.


Person 1 went shopping in supermarket X and bought product A,B,C

Person 2 went shopping in supermarket Y and bought A,D,E

My main question is how can I visualise a strong link between supermarket and specific products in a meaningful way - ideally in R?

So to speak: I want to point out the "specialities" of a supermarket.

The category "supermarket" is limited to about 12 factors, the products are quite diverse and contain over one hundred different products. The number of products is unknown and does not matter in the current context since this is only an example.

I want to get rid of the "background noise" of products that are frequently bought by the overall sample and want to point out that a buy of product B is strongly associated with shopping in supermarket Y, but masking product A which is bought more or less equally frequent in all other supermarkets.

I already tried to subtract the frequency of products bought in each supermarket by the frequency of products bought in the total sample and creating a barplot with the top-20 products with positive difference in frequency difference, but I wonder if there is a more "fancy" and overall better approach to this problem.

  • 1
    $\begingroup$ Are you interested in the person-specific trends (specifically what products does each person buy more frequently where) or are you interested in the global trend (which products are purchased more frequently in total)? $\endgroup$ – user2974951 Feb 15 at 9:18
  • $\begingroup$ I would say neither. The special interest is not the global trend nor person-specific, but vendor specific.Which vendor sells more of specific products than the overall market. "frequency of A bought in supermarket X is higher than the overall marked would assume" $\endgroup$ – pteridin Feb 15 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.