Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: exporting tables from Summarize function


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: exporting tables from Summarize function
Date   Tue, 24 May 2011 12:41:07 +0100

Same answer from me.

. tab country

. di r(r)

If necessary put the condition

. tab country if !missing(x1)

Also, with -distinct- (SJ) as earlier referenced.

. distinct country if !missing(x1)

Nick

On Tue, May 24, 2011 at 12:33 PM, lreine ycenna <[email protected]> wrote:
> Hi Nick,
> I will def. need the tab command later. Thanks.
>
> What I meant was like this:
> In the example below, 3 countries are covered by the variable x1.
> When I run a regression (xtreg) with x1, that will give me the number
> for countrynumber.
> But I was wondering if there's a command like 'tab' which will give me
> the count.
>
> countryno       x1
> 1       0.55
> 1       0.55
> 1       0.55
>        0.55
> .       0.55
> .       0.55
> 2       0.55
> 2       0.55
> 2       0.55
> 2       0.55
> .       3.31
> .       3.87
> .       4.42
> .       4.97
> .       5.52
>        6.08
> .       6.63
> 3       7.18
> 3       7.73
> 3       8.29
>
>
>
> On 24 May 2011 11:49, Nick Cox <[email protected]> wrote:
>> I am not clear what "covered by" means in Stata terms.
>>
>> . tab country
>>
>> lets you count distinct countries, which are returned in r(r).
>>
>> Also see
>>
>> SJ-8-4  dm0042  . . . . . . . . . . . .  Speaking Stata: Distinct observations
>>        (help distinct if installed)  . . . . . .  N. J. Cox and G. M. Longton
>>        Q4/08   SJ 8(4):557--568
>>        shows how to answer questions about distinct observations
>>        from first principles; provides a convenience command
>>
>> Nick
>>
>> On Tue, May 24, 2011 at 11:31 AM, lreine ycenna <[email protected]> wrote:
>>> by the way, I have a variable x1 for 100 countries (sorted by country
>>> number). But it's unbalanced data.
>>> Is there anyway to know how many countries are covered by x1?
>>>
>>> eg. 200 observations for x1 covering 70 countries ?
>>>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index