title: Sum columns based specific row and sum rows based on specific column as new variable
body: <p>I want to construct a 2x2 contingency table to compute the odds ratio. However, I fail to sum up the rows and columns as I wanted them to be. This is my contingency table for now. I want to total up Down Steady and Up into a new variable named Yes.</p>
  <pre><code>|        |Down|No|Steady|Up|
  |--------|----|--|------|--|
  |Female  |    |  |      |  |
  |Male    |    |  |      |  |
  |Female.1|    |  |      |  |
  |Male.1  |    |  |      |  |
  |Female.2|    |  |      |  |
  |Male.2  |    |  |      |  |
  </code></pre>
  <p>I have tried using colsums but it just totals up the entire column.
  The output I want is like this:</p>
  <pre><code>|      |Yes|No|
  |------|---|--|
  |Female|   |  |
  |Male  |   |  |
  </code></pre>
  <p>Thank you in advance!</p>