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

Re: st: Summary stats


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: Summary stats
Date   Mon, 19 Jul 2004 10:14:57 -0400 (EDT)

> I have a dummy variable with 11 categories. I have
> only used 4 of these due to lack of sufficient data
> for the others. Now I want to do an end of regression
> summary of all the variables I used in the regression.
> I want the observations for all these variables to
> equal the number obviouly I had, when I ran all the
> equations. At the moment, either the total number of
> means, total more than 1, for these dummies, I
> mentioned in the beginning or the number of
> observations are not the same as the original
> equations. I tried
> .ge other=.
> .replace other=0 if x1==1|x2==1|x3==1|x4==1    (1)
> .replace other=1 if x1==1|x2==1|x3==1|x4==4    (2)
> .su other
>
> But the means are either > 1 for these set of dummy
> variables I mentioned earlier or the observations do
> not equal to that of the regression. I even tried
> using approximately equal to sign in (2), but had the
> same problems.
>
> If you need further clarification, please let me know.

well it is not at all clear what exactly you want (Statalist FAQ
postulates that you should post the output of your relevant commands so
that other users would be able to figure out what is going wrong), but my
gut feeling is that you need to figure out how -e(sample)- works. Stata
saves quite a bit about the estimated regression, and part of that is the
-e(sample)- variable that is equal to 1 if an observation was used in the
regression, and 0 otherwise. So a part of your command might read

sum ... if e(sample)

I am also used to thinking of dummy variables taking only values 0 and
1... rather than having 11 categories (which I would then call a
categorical variable).

Also, there is no approximately equal sign in Stata. If you meant
something like

if x1~=1

then it meant "not equal to".

 ---                                    Stas Kolenikov
 --       Ph.D. student in Statistics at UNC-Chapel Hill
 - http://www.komkon.org/~tacik/  -- [email protected]

* This e-mail and all attachments to it are not intended to provide any
* reasonable point of view and was transmitted to you in error. It
* should be immediately deleted by all recipients unless they really
* enjoy communicating with the author :). Other restrictions apply.

*
*   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