title: Stata: Combine and Sort categories
body: <p>Is that possible to ask stata to combine variables and sort them out in order?</p>
  <p>My data file is a list of inventories, look something similar to the picture posted below. I have in total of 7 categories that I assign to a specific characteristic. However, these categories are not in order. For example, one would have satin and damask and the next would be damask and satin. Is that possible to ask stata to combine variables and sort them out in order?</p>
  <p>I want to have a final column that contains all 7 categories and in order. For instance, no matter if the previous column's order is satin and damask or damask and satin, it will all become satin and damask at the end. No matter if the previous columns write fox wool satin in whatever order, it became the same order at the last column. There are about 100s of different words in the first category and then less and less in the following.</p>
  <p>Then I can convert this from long-form to short-form to form a person list instead of a list of inventories for further graphing and calculations.<a href="https://i.stack.imgur.com/qylpL.png" rel="nofollow noreferrer">enter image description here</a></p>