Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Tabulating "missing" values


From   "J. Michael Oakes" <[email protected]>
To   Statalist <[email protected]>
Subject   st: Tabulating "missing" values
Date   Wed, 09 Apr 2003 14:16:13 -0500

Hoping this isn't too obvious, but I cannot figure out how to fill-in rows
for response values that do not appear in my data but do exist
hypothetically.

Imagine a variable, call it q5, that has possible responses 1, 2, 3, and 4;
let it be a simple Likert scale for example. The trouble is if survey
respondents only endorse/check values of 3 or 4, then my table will look
like this


. tab q5, nolab

            |
       q5   |
            |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |         14       24.14       24.14
          4 |         44       75.86      100.00
------------+-----------------------------------
      Total |         58      100.00


But what I want is (something like) this, which I made the "hard-way" via
cut/paste


       q5   |
            |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |          0        0.0          0.0
          2 |          0        0.0          0.0
          3 |         14       24.14       24.14
          4 |         44       75.86      100.00
------------+-----------------------------------
      Total |         58      100.00


In this example the hypothetical values of 1 and 2 are represented, which is
nice if I want to apply value labels and such for presentation.

I've looked at -tabcond- and a few other adaptations but cannot find what I
want -- I do not seem to understand -tabcond- if that would do the trick.

Solutions?

Cheers - Michael Oakes



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index