Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: missing observations in tabulate


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: missing observations in tabulate
Date   Wed, 12 Jun 2013 16:49:48 +0100

In a recent answer I referred you to -egen-.

egen nonmiss = count(dpc), by(year)
egen number = count(1), by(year)

tabulate ..  if nonmiss/number >= 1/3

I presume you mean _2/3 or more_..

If your panel is balanced, you can simplify this using the variable -nonmiss-.




Nick
njcoxstata@gmail.com


On 12 June 2013 16:42, Abu Camara <abucamara@gmail.com> wrote:
> Hi Statalist,
>
> I wrote the following code to do some tabulation. But I  want to
> suppress the output
> for any year that has 2/3 of the observations missing.That is if 2/3
> of the countries have observations
> missing for any given year. I am using World Bank WDI database to do
> some regional aggregation.
> What should be the approriate code here?
>
> table country year [aweight=pop], c(mean dpc), if region==2 & oil==1, row
>
> --
> Best Wishes,
> Abu Camara
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index