title: Labelling Subgroups in a String variable (Stata)
body: <p>I am trying to label subgroups within a string categorical variable:
  I have a sex variable stored in &quot;double&quot; format and to make it easier to use in graphs, I converted the variable into string as below</p>
  <pre><code>tostring sex, gen(sex_str)
  </code></pre>
  <p>And then I wanted to label the groups following instructions <a href="https://stats.idre.ucla.edu/stata/modules/labeling-data/" rel="nofollow noreferrer">here</a>, and it worked:</p>
  <pre><code>label define sex_strlabel 1 &quot;Male&quot; 2 &quot;Female&quot; 
  </code></pre>
  <p>However, when I ran the code below I got this error message &quot;may not label strings&quot;</p>
  <pre><code>label values sex_strsex_strlabel 
  </code></pre>