title: inaccurate percentages in expss table
body: <p>I'm analyzing some survey data and using <code>expss</code> to create tables.</p>
  
  <p>One of our questions is about brand awareness. I have 3 types of brands: BrandA is a brand that a large subset of the sample sees, BrandB is a brand that a smaller (mutually exclusive!) subset of the sample sees, and BrandC is a brand that every respondent sees. </p>
  
  <p>I'd like to treat this awareness question as a multiple response question and report the % of people (who actually saw the brand) who are aware of each brand. (In this case, a value of 1 means that the respondent was aware of the brand.) </p>
  
  <p>The closest I can get is by using the code below, but <code>tab_stat_cpct()</code> is not reporting accurate percentages or # of cases, as you can see in the attached table. When you compare the Total % listed in the table to the total % computed manually (i.e., via <code>mean(data$BrandA, na.rm = TRUE)</code>), it is reporting values that are too low for BrandA and BrandB, and a value that is too high for BrandC. (Not to mention that the total # of cases should be 25.)</p>
  
  <p>I've read over the documentation, and I understand that this issue is due to how <code>tab_stat_cpct()</code> defines a "case" for the purposes of computing the percentage, but I don't see an argument that will adjust that definition to do what I need. Am I missing something? Or is there some other way of reporting accurate percentages? Thanks!</p>
  
  <pre><code>set.seed(123)
  
  data &lt;- data.frame(
      Age = sample(c("25-34", "35-54", "55+"), 25, replace = TRUE),
      BrandA = c(1, 0, 0, 1, 0, 1, NA, NA, NA, NA, NA, NA, NA, 1, 
                 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1),
      BrandB = c(NA, NA, NA, NA, NA, NA, 1, 1, 0, 1, 0, 1, 1, NA, 
                 NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
      BrandC = c(1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 
                 1, 1, 1, 0, 1, 0, 1, 0, 1)
  )
  
  data %&gt;%
      tab_cells(mrset(as.category(BrandA %to% BrandC))) %&gt;%
      tab_cols(total(), Age) %&gt;%
      tab_stat_cpct() %&gt;%
      tab_last_sig_cpct() %&gt;%
      tab_pivot()
  
  ##    |              | #Total |     Age |       |      |
  ##    |              |        |   25-34 | 35-54 |  55+ |
  ##    |              |        |       A |     B |    C |
  ##    | ------------ | ------ | ------- | ----- | ---- |
  ##    |       BrandA |   52.4 |  83.3 B |  28.6 | 50.0 |
  ##    |       BrandB |   23.8 |         |  42.9 | 25.0 |
  ##    |       BrandC |   71.4 | 100.0 C |  71.4 | 50.0 |
  ##    | #Total cases |     21 |     6   |     7 |    8 |
  </code></pre>