I have a data set of categorical data where each question can have more than one answer. This is a toy example:

question one: what did you eat today?

subject 1 :  Potatoes, Apples

subject 2 : Apples

subject 3 : Honey, Potatoes, Apples

question two: which TV shows do you watch?

  subject 1 :  House, Dexter

  subject 2 : TWD, Dexter

  subject 3 : The news

I need to get a similarity measure between, for example, distfun(Potatoes and Apples, Honey and Apples). I dont think that ordinary multivariate categorical analysis measures deal with this kind of responses. Can someone share some light over which measures use by referring me to some explanatory paper that he knows please?

Thanks in advance

EDIT: 1.- The order of the responses is not important. 2.- I am not just looking for a way to solve the issue ASAP by using the a modified version of the "overlap" distance that is used for multivariate categorical data but to find the framework that deals with this kind of stuff. Thanks for your responses.

  • $\begingroup$ What would such a distance function look like, even theoretically? Perhaps it would be good if you tell us what you need this distance function for; that is, what are your hypotheses/research questions? $\endgroup$
    – Peter Flom
    Apr 29, 2013 at 10:24
  • $\begingroup$ the data set is a number of linguistic attributes of certain towns. Each linguistic attribute has a number of arbitrary responses per town. $\endgroup$
    – Usobi
    Apr 29, 2013 at 10:31
  • $\begingroup$ Let take as example the so called "overlap" measure in multivariate categorical data. How can I apply something "similar" here and where does it appear. Thanks for the help $\endgroup$
    – Usobi
    Apr 29, 2013 at 10:33
  • $\begingroup$ Well, you could count the number of terms in common, perhaps weighting by the frequency of such an overlap, but that's just an idea, purely on my intuition. Maybe someone else will have a better answer. $\endgroup$
    – Peter Flom
    Apr 29, 2013 at 10:34
  • $\begingroup$ You have "multiple response" question(s). So, format your data as binary variables, each response category is a variable (e.g. "potatoes" var, "apples" var) and values are 1 (selected) or 0 (not selected). Then choose among plenty binary association measures (see e.g. here). $\endgroup$
    – ttnphns
    Apr 29, 2013 at 11:44

1 Answer 1


If the order of the answers does not matter, you could count the number of common items, so that e.g. d=dist(P and A, H and A) = 1. (this measures the similarity rather then the distance, you may invert it , i.e. 1/d, to get the opposite direction). If the order matters (e.g. if it is a prioritized list), you could use something like the Hamming distance, or the Kendall distance.

  • 1
    $\begingroup$ Thanks, indeed the order does not matter. I could use a measure like the one you proposed but one of my main problems is that I do not know on which framework I am. It is not "strict sensu" multivariate categorical data and I would like to get more info about this. $\endgroup$
    – Usobi
    Apr 29, 2013 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.