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

Re: st: RE: tab


From   David Kantor <dkantor@jhu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: tab
Date   Thu, 11 Dec 2003 09:45:44 -0500

At 01:25 PM 12/11/2003 +0000, Nick Cox wrote:
[...]

2. -tabulate- is reluctant to tabulate classes which
don't exist in the data. In particular, you can't
get zero counts out of -tabulate <myvar>-.

[...]
-tabulate- can give zero counts, using the -subpop(...)- option.

If var2 restricts the dataset so as to exclude some of the values of myvar, then

tabulat myvar, subpop(var2)

will have zero entries for the values in question.

(And presumably, this would hold under -if- or -in- restrictions, as long as var2 further restricts the dataset so as to exclude some values of myvar.)

If you really want to see some nonexistant values in a -tabulate-, you can extend the dataset to include them, and then create a variable that serves as an indicator for the "actual" data. Then present that variable in the -subpop(...)- option.

--David


David Kantor
Institute for Policy Studies
Johns Hopkins University
dkantor@jhu.edu
410-516-5404

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index